English
Source / code snippets

Choosecolor2 dialog

 

Uwe
''Pascal''
Niemeier
Hi people!

another News Snippet: One dialog to Farbauswahl.
CompileMarkSeparation
window 400,400
 $H Windows.ph
usermessages 16
var Ini$="X:Test.ini"************************* Pfad bitte anpassen!

proc ChooseColor2---------------------------------------ChooseColor2

    parameters rgb#
    declare a#:dim a#,36--CHOOSECOLOR
    var Color&=long(rgb#,64)
    long a#,0=36,%hwnd,0,Color&,rgb#,11
    Color&=if(external("comdlg32","ChooseColorA",a#),long(a#,12),-1)
    case Color&>=0:long rgb#,64=Color&
    dispose a#
    return Color&
    endproc-------------------------------------------------------------
    declare b#:dim b#,64+4--Array für 16 benutzerdefinierte Farben + gewählte Farbe
    var Result&=~GetPrivateProfileStruct("Config","Color",b#,68,addr(Ini$))

    ifnot Result&----------Vorgaben, falls Ini noch nicht vorhanden

        long b#,0=$FFDDDD,$DDFFDD,$DDDDFF,$FFFFDD,$FFDDFF,$DDFFFF--Definierte Farben
        long b#,64=$F0F0F0--Aktuelle Farbe

    endif

    cls long(b#,64)--zuletzt gewählte Farbe, gelesen aus Ini

    while 1

        waitinput
        case %umessage=16:break
        Result&=ChooseColor2(b#)
        case Result&>=0:cls Result&

    endwhile

    ~WritePrivateProfileStruct("Config","Color",b#,68,addr(Ini$))

in the Contrast to that profanen ChooseColor  becomes here a Memory-Variable transfer,
in the as LongInts 16 colours for "Benutzerdefinierte Farben"-boxes + The vorgewählte colour stored are.
with verify becomes this aray aktualisiert; The chosen colour becomes additional directly zurückgegeben.
with terminate becomes the aray with all colours by API in a Ini written,
so it at next Start again read go kann; any colours stand then again available

PS: If one a# and b# To Beginn the Program global "zur general Verwendung" declared/dimensioniert,
The whole thing is yet something plainer

Happy solid you all!
Pascal
 
12/23/09  
 




Frank
Abbing
Hi,

I sustain unfortunately only one leeres Window.
 
12/23/09  
 




Frank
Abbing
Ah, Extraklick necessary... then GEHTS.
 
12/23/09  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.289 Views

Untitledvor 0 min.
RudiB.04/19/22
Matzbub12/29/18
rquindt11/28/17
Jochen Roxlau04/15/15

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie