![]() |
Farbwahl bei PALM
Hallo zusammen,
weiß jemand wie man beim PALM die Zeichefarbe für Linien wechselt. Verwendet wird WINSOFT Pocke Studio 2.0. Danke |
Re: Farbwahl bei PALM
Hängt vom OS ab, da das OS lange Zeit garkeine Farben unterstützte.
Um es teilweise OS unabhängig zu machen habe ich mir folgende Routinen gecodet:
Delphi-Quellcode:
Wie man sieht wird beim Palm OS von einem Object-Farbindex der in eine Object-Farb-Tabelle zeigt in einen Device-Farbindex der in eine Device-Farb-Tabelle zeigt in den realen Farbwert konvertiert. Also eigentlich ziemlich bescheuert.
function CheckROMVersion(RequiredVersion: UInt32): Boolean;
var RomVersion: UInt32; begin FtrGet(sysFtrCreator, sysFtrNumROMVersion, RomVersion); Result := RomVersion >= RequiredVersion; end; function WinSetFgColor(FgColor: IndexedColorType): IndexedColorType; type TWinSetForeColor = function(foreColor: IndexedColorType): IndexedColorType; var P: Pointer; begin if CheckROMVersion($03503000) then begin P := SysGetTrapAddress(sysTrapWinSetForeColor); Result := TWinSetForeColor(P)(FgColor); end else Result := FgColor; end; function WinSetBkColor(BkColor: IndexedColorType): IndexedColorType; type TWinSetBackColor = function(backColor: IndexedColorType): IndexedColorType; var P: Pointer; begin if CheckROMVersion($03503000) then begin P := SysGetTrapAddress(sysTrapWinSetBackColor); Result := TWinSetBackColor(P)(BkColor); end else Result := BkColor; end; function WinSetTxColor(TxColor: IndexedColorType): IndexedColorType; type TWinSetTextColor = function(textColor: IndexedColorType): IndexedColorType; var P: Pointer; begin if CheckROMVersion($03503000) then begin P := SysGetTrapAddress(sysTrapWinSetTextColor); Result := TWinSetTextColor(P)(TxColor); end else Result := TxColor; end; function ColorIndex(ColorIndex: UIColorTableEntries): IndexedColorType; type TUIColorGetTableEntryIndex = function(which: UIColorTableEntries): IndexedColorType; var P: Pointer; begin if CheckROMVersion($03503000) then begin P := SysGetTrapAddress(sysTrapUIColorGetTableEntryIndex); Result := TUIColorGetTableEntryIndex(P)(ColorIndex); end else Result := 0; end; procedure Test; var C: IndexedColorType; begin C := WinSetFgColor(ColorIndex(UIFieldTextLines)); WinDrawGrayLine(0, 10, 160, 10); WinSetFgColor(C); end; Gruß Hagen |
Re: Farbwahl bei PALM
besten Dank für die Infos,
eine Suche bei google und co hatte mich nicht weitergebracht, ich werde jetzt mal probieren ob ich damit klarkomme. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:50 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz