Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


createCheckBox syntax

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Mon Sep 29, 2014 10:24 pm    Post subject: createCheckBox syntax Reply with quote

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
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Sep 30, 2014 2:38 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Tue Sep 30, 2014 6:14 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Sep 30, 2014 6:24 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Tue Sep 30, 2014 7:59 am    Post subject: Reply with quote

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



RedLabel.png
 Description:
 Filesize:  29.29 KB
 Viewed:  5013 Time(s)

RedLabel.png


Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites