SetDialogObjectFont anomaly

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

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

SetDialogObjectFont anomaly

Post by JRL » Thu Feb 19, 2009 11:42 pm

Running Win XP sp2 and Macro Scheduler 11.1.04

This script displays a dialog. Clicking the checkbox in the dialog should make all text in the dialog switch from red to green.

On my desktop computer running this script and clicking the checkbox changes all the colors from red to green to red to etc. I've tried this on two relatively new Dell laptops and not all of the colors change. All of the sizes are set to the larger font but the colors of the button the checkbox and the radiogroup all stay black. I'm wondering if anyone else has any issues running the script? And whether anyone has any ideas why the laptops are color challenged?

Thanks,
Dick

[code]
Dialog>Dialog1
Caption=Color Change Test
Width=539
Height=312
Top=CENTER
Left=CENTER
Label=Part Number:,32,16,true
Label=Revision:,32,48,true
CheckBox=msCheckBox1,Change Color,27,87,118,True
Button=BLUEPRINTS,24,131,262,40,3
Edit=msEdit1,29,181,121,TEST
Memo=msMemo1,158,12,185,89,TEST
ListBox=msListBox1,359,11,121,97,Item1%CRLF%Item2
ComboBox=msComboBox1,358,115,145,Item1%CRLF%Item2
RadioGroup=msRadioGroup1,Test,329,148,185,105,Item1%CRLF%Item2,-1
EndDialog>Dialog1

SetDialogObjectColor>Dialog1,,16777215

Let>Blue=16744576
Let>Green=5878528
Let>Red=128
Let>ccflag=1

SetDialogObjectFont>dialog1,mslabel1,Arial,12,1,red
SetDialogObjectFont>dialog1,mslabel2,Arial,12,1,red
SetDialogObjectFont>dialog1,msbutton1,Arial,24,1,red
SetDialogObjectFont>dialog1,msCheckBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msEdit1,Arial,12,1,red
SetDialogObjectFont>dialog1,msMemo1,Arial,12,1,red
SetDialogObjectFont>dialog1,msListBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msComboBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msRadioGroup1,Arial,12,1,red

Show>dialog1

Label>Loop
GetDialogAction>dialog1,res1
If>res1=2
Exit>0
EndIf
If>res1=3
ResetDialogAction>dialog1
mdl>OK
EndIf
If>{(%dialog1.mscheckbox1%="True") and (%ccflag%=1)}
SetDialogObjectFont>dialog1,mslabel1,Arial,12,1,red
SetDialogObjectFont>dialog1,mslabel2,Arial,12,1,red
SetDialogObjectFont>dialog1,msbutton1,Arial,24,1,red
SetDialogObjectFont>dialog1,msCheckBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msEdit1,Arial,12,1,red
SetDialogObjectFont>dialog1,msMemo1,Arial,12,1,red
SetDialogObjectFont>dialog1,msListBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msComboBox1,Arial,12,1,red
SetDialogObjectFont>dialog1,msRadioGroup1,Arial,12,1,red
Let>ccflag=2
EndIf
If>{(%dialog1.mscheckbox1%="False") and (%ccflag%=2)}
SetDialogObjectFont>dialog1,mslabel1,Arial,12,1,green
SetDialogObjectFont>dialog1,mslabel2,Arial,12,1,green
SetDialogObjectFont>dialog1,msbutton1,Arial,24,1,green
SetDialogObjectFont>dialog1,msCheckBox1,Arial,12,1,green
SetDialogObjectFont>dialog1,msEdit1,Arial,12,1,green
SetDialogObjectFont>dialog1,msMemo1,Arial,12,1,green
SetDialogObjectFont>dialog1,msListBox1,Arial,12,1,green
SetDialogObjectFont>dialog1,msComboBox1,Arial,12,1,green
SetDialogObjectFont>dialog1,msRadioGroup1,Arial,12,1,green
Let>ccflag=1
EndIf
Goto>Loop
[/code]

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Feb 20, 2009 12:22 am

Hi JRL,

Running Win XP SP3 and Macro Scheduler 11.1.04 here.

The following text strings on the dialog do not change for me:

Change Colo (by the checkbox)
BLUEPRINTS
Test (the group name of the radio buttons)
Item 1 (next to the radio button)
Item 2 (next to the radio button)

This is an older desktop (Pentium 4 - 3 GHz) not a laptop.
Last edited by jpuziano on Fri Feb 20, 2009 5:15 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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

Post by JRL » Fri Feb 20, 2009 3:33 am

Thanks for checking jpuziano. That's the same result as the laptops. I wonder if there is some Windows dll version issue.

It works correctly on my home computer.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Feb 20, 2009 4:46 am

Hi JRL,

Not a problem, glad to help.

I just tried it on my home computer where I'm running Macro Scheduler Pro Ver 11.1.04 on XP Professional Version 2002 SP3.

It fails here in exactly the same way as it did on my work computer and evidently your laptops... those same items did not change color.

Could it be possible it works correctly with SP2 but not with SP3? What exactly is your home computer running JRL?

I'll do a Windows Update to get all the latest patches from Microsoft and try it again... and if its any different I'll post but I'm guessing it won't change.

Marcus can you replicate this problem on XP SP3?
Last edited by jpuziano on Fri Feb 20, 2009 5:14 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Feb 20, 2009 4:54 am

I got the same results on Compaq laptop, Macro Scheduler 11.1.04, XP PRO-SP2.

Button, RadioGroup, and CheckBox stay black.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by JRL » Fri Feb 20, 2009 5:32 am

Thanks for the input Bob and Jpuziano

The work computer where it all displays correctly is XP pro sp3 but it started out as a pre-service pack XP installation.

The Home computer where it also all displays correctly is XP pro sp1.

The two Dell laptops that display incorrectly are a little over a month old and are both XP pro sp3. IF it matters they were purchased at the same time and are configured identically.

Another thought is that the work and home computers that display correctly each started on version 7.0 of Macro Scheduler and have had nearly every version build installed on them. The two laptops have only ever seen version 11.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Feb 20, 2009 9:11 pm

jpuziano wrote:I'll do a Windows Update to get all the latest patches from Microsoft and try it again... and if its any different I'll post but I'm guessing it won't change.
I was right, even the latest patches from Microsoft did not help, still fails.

Marcus can you replicate this problem on XP SP3?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Feb 20, 2009 10:12 pm

Has anyone besides me noticed that Marcus has been unusually absent for the past few days? Hope all is OK.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by JRL » Sat Feb 21, 2009 7:55 am

Has anyone besides me noticed that Marcus has been unusually absent for the past few days? Hope all is OK.
Yes, I've noticed. His last forum post was on the 16th though he did Blog yesterday. I also hope all is Ok.

As a test I compiled this script and found that the compiled version behaves the same as the script. Another thing I noticed is that the computers the object colors are failing on have Microsoft .NET installed. The computers that the object colors work correctly on do not.

Does this script display object colors correctly for anyone else?

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

Post by Rain » Sat Feb 21, 2009 2:50 pm

I got the same result on my Gateway DX4710-UB801A, Macro Scheduler 11.1.04
OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 3 Build 2600

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sat Feb 21, 2009 8:14 pm

JRL wrote:Another thing I noticed is that the computers the object colors are failing on have Microsoft .NET installed. The computers that the object colors work correctly on do not.
Interesting... Perhaps .NET installs a different version of a DLL that is causing the problem.

Do you have a PC where you can test the macro, install .NET then test again?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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

Post by JRL » Mon Feb 23, 2009 3:09 pm

Ok... I have a discovery to report. The difference between seeing all objects in color and not seeing all objects in color in Windows XP seems to be the difference between "Windows XP Style" and "Windows Classic Style". If it is not the definitive difference, at least on my computers I can turn it on and off by changing from one style to the other.

To test for yourself. Go to "Display Properties" and select the "Appearance" tab. Under "Windows and Buttons" select "Windows Classic Style" and the above script should display all of the dialog objects in color. Select "Windows XP Style" and the checkbox, the button and the radiogroup will be plain black.

Could those of you who have been kind enough to test this previously, try the setting "Windows Classic Style" and report back to the forum your findings?

Thank you
Dick

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Feb 23, 2009 3:55 pm

I'm still on 9 and can't test this, but I've had similar problems in the past so I think that is a very logical conclusion.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 23, 2009 5:47 pm

Good work Dick.

I can confirm your result.
XP-PRO SP-2, Macro Schedjuler 11.1.04

XP style fails
XP Classic is good.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Feb 23, 2009 5:58 pm

Hi JRL,

I confirm your findings. Under "Windows and buttons", mine was set to "Media Center style" and I was seeing some black text as described earlier. When I changed the setting to "Windows Classic Style" then the macro flipped all text colors between red and green as intended. When I filpped it back again to "Media Center style", it failed as before.
  • Problem: In XP, for the SetDialogObjectFont> command, the text colors chosen will only be displayed correctly if the PC is set to: Display Properties/Appearance/Windows and buttons/"Windows Classic Style"

    Other settings like "Media Center style" or "Windows XP Style" may result in different colors being displayed for some dialog text (probably black).
Marcus, its impractical to force a user to change this setting so a certain macro will work properly... so now that we know what is causing this, how do we get around it?

Question 1: Could the code behind the SetDialogObjectFont> command be changed so as to not be dependant on this Windows setting?

Question 2: If #1 is not possible, could you please add a warning to the Help File? Under the SetDialogObjectFont> command, it should say that unless this Windows setting is "Windows Classic Style", the chosen text color may not be displayed.

Question 3: Does anyone have the code required to programatically determine the setting? No doubt its in the registry somewhere. If we had this, we could use it in a macro... and if the setting was "Windows Classic Style"... proceed... but if it wasn't, popup a warning to the user informing them that text colors on dialogs may be wrong and not to rely on them... or even suggesting they go and change the setting in Windows... if they want to see the intended dialog text colors.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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