View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Mon Sep 29, 2014 10:24 pm Post subject: createCheckBox syntax |
|
|
I looked through the code for checkboxes and could not find a control to change the font color of the caption from default to red, green or blue.
Any suggestions on how to make this happen?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Sep 30, 2014 2:38 am Post subject: |
|
|
The checkbox color is defined by the windows theme. It can't be changed. (It's how microsoft likes it)
What you could try is place a label behind a checkbox with no text and give that label the description and a color that you like
Else use a paintbox or image and display your own checkbox
Or tell your users to disable windows themes for your app
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Tue Sep 30, 2014 6:14 am Post subject: |
|
|
I don't understand the manner in which the language is developed:
Code: |
function Font_setColor(L: PLua_State): integer; cdecl;
var
Font: TFont;
begin
Font:=luaclass_getClassObject(L);
if lua_gettop(L)>=1 then
Font.color:=lua_tointeger(L, -1);
result:=0;
end;
|
I tired the following, but didn't work, but no errors:
Code: |
self.exp_label = createLabel(self.form);
self.exp_label.height = 20;
self.exp_label.left = 240;
self.exp_label.width = 75;
self.exp_label.top = 97;
self.exp_label.TFont = 255 |
What would be the correct statement?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Sep 30, 2014 6:24 am Post subject: |
|
|
self.exp_label.Font.Color=255
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Tue Sep 30, 2014 7:59 am Post subject: |
|
|
It never is that easy, but after some trial and error:
Code: |
self.exp_cb = createCheckBox(self.form);
self.exp_cb.Caption = '';--'Constant 100 Exp';
self.exp_cb.Height = 20;
self.exp_cb.Left = 240;
self.exp_cb.Width = 75;
self.exp_cb.Top = 97;
self.exp_label = createLabel(self.form);
self.exp_label.Caption = 'Constant 100 Exp';
self.exp_label.height = 20;
self.exp_label.left = 255;
self.exp_label.width = 75;
self.exp_label.top = 97;
self.exp_label.Color = 246; |
I had to delete the caption for the checkbox add it into the label and then adjust the position. I'm going to try font color next.
One question though what is the correct code to right justify a text?
Thanks
Description: |
|
Filesize: |
29.29 KB |
Viewed: |
5013 Time(s) |
|
|
|
Back to top |
|
|
|