Jump to content
Developer Wiki and Function Reference Links ×

Create ColorButton


tobibo

Recommended Posts

  • 3 months later...

Hi,

GetColorButton & SetColorButton work with the system color palette control:

PROCEDURE MoreDocumentation;

VAR

dialogID : LONGINT;

red, green, blue : LONGINT;

PROCEDURE HandleColourPicker(VAR item : LONGINT; data : LONGINT);

BEGIN

CASE item OF

SetupDialogC: BEGIN

SetColorButton(dialogID, 10, 65535, 0, 0);

END;

10: BEGIN

GetColorButton(dialogID, 10, red, green, blue);

RGBToColorIndex(red, green, blue, gColour);

END;

END;

END;

BEGIN

dialogID := CreateLayout('Colour Picker', FALSE, 'Ok', 'Cancel');

CreateControl(dialogID, 10, 2, 'Colour', 2);

SetFirstLayoutItem(dialogID, 10);

IF RunLayoutDialog(dialogID, HandleColourPicker)=0 THEN BEGIN END;

AlrtDialog(Num2Strf(gColour));

END;

Regards,

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...