Option to make msLabel clickable and different font colors

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Option to make msLabel clickable and different font colors

Post by Rain » Wed Apr 02, 2008 1:39 pm

I would like to see an option to select a different font color for each msLabel. E.g. have one label blue, one label read and one label green. And the ability to make msLabels in the dialog clickable just like the image. Yes I know I can accomplish the same with an image but that would mean I have to first create and then import the image.

Thank you for a great product.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Apr 02, 2008 1:42 pm

You can set the font style/size/colour with the SetDialogObjectFont function introduce in v10.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Selectable label sample script

Post by JRL » Wed Apr 02, 2008 10:17 pm

Here is a script that appears to provide a selectable label. It is actually a label and an image definition occupying the same space. The image doesn't even exist. No need to precreate any images. The entire image specification area is available for selection so make the image area big enough to cover the label.

-- This script requires Macro Scheduler Version 10

-- The label must appear in the dialog before the image.

Hope this is helpful

Code: Select all

Dialog>Dialog1
   Caption=Try this
   Width=400
   Height=200
   Top=278
   Left=366
   Label= ,74,90,
   Image=c:\noimage.bmp,74,90,250,20,,200
   Button=Do Not Select this button,68,18,260,40,100
EndDialog>Dialog1

RGB>0,0,255,color

SetDialogObjectFont>Dialog1,msLabel1,Arial,20,0,%color%
SetDialogObjectFont>Dialog1,msButton1,Arial,15,1,255

Show>Dialog1
Let>dialog1.mslabel1=Pick this text instead

Label>Loop
GetDialogAction>dialog1,res1
If>res1=2,EOF
If>res1=100
  SetDialogObjectFont>Dialog1,msLabel1,Arial,14,0,255
  Let>dialog1.mslabel1=Do you ever follow directions?
  ResetDialogAction>dialog1
EndIf
If>res1=200
  SetDialogObjectFont>Dialog1,msLabel1,Arial,20,0,%color%
  Let>dialog1.mslabel1=Good... That worked
  ResetDialogAction>dialog1
  Wait>2
  Let>dialog1.mslabel1=Pick this text instead
  ResetDialogAction>dialog1
EndIf
Wait>0.01
Goto>Loop

Label>EOF

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Thu Apr 03, 2008 10:22 pm

Thanks Marcus. I forgot all about that. Guess I should have read the help file.
Do you think it's possible to make msLabels clickable?

Thank you JRL. I will give it try.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts