Posted by member 117088 on 2004-03-03 22:33:34
I’m working on a set of If statements to relocate some buttons according to my screen resolution. This would not be as much of a big deal if I didn’t have dual monitors…but I do and I’m not giving them up for this! So I’m going to have to reconcile the differences between the theme (Saphardana) and my monitors. :)
My monitors are currently set to 1280x1024 and the line of code I changed to relocate this button works correctly…
*Shortcut "Internet Browser" 1253 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
…(just to clear this up before one asks, I using 1253 instead of -27 because my screen width is not 1280, but its 2560 b/c of the dual monitors) Well that works if I don’t change my screen resolution, but I like to change my resolution to accommodate what I’m working on like CAD or PhotoShop. So I wanted to create some If statements to make my life easier. Here is what I wrote…
*Shortcut "File Manager" 12 -22 spacer3.png spacer4.png .none #2TO !execute ["$FileManager$"]
If ResolutionX = 800
*Shortcut "Internet Browser" 773 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1023
*Shortcut "Internet Browser" 996 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1152
*Shortcut "Internet Browser" 1125 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1280
*Shortcut "Internet Browser" 1253 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1600
*Shortcut "Internet Browser" 1573 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
EndIf
…The result of this code ends up making the spacer3.png button disappear. I modlded my code after the authors code that changed the BottombarXXX.png file according to the resolution. His looked like this…
If ResolutionX = 800
*Shortcut "" 56 2 Topbar800.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar800.png .none .none #2 !None
ElseIf ResolutionX = 1024
*Shortcut "" 56 2 Topbar1024.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1024.png .none .none #2 !None
ElseIf ResolutionX = 1152
*Shortcut "" 56 2 Topbar1152.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1152.png .none .none #2 !None
ElseIf ResolutionX = 1280
*Shortcut "" 56 2 Topbar1280.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1280.png .none .none #2 !None
ElseIf ResolutionX = 1600
*Shortcut "" 56 2 Topbar1600.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1600.png .none .none #2 !None
EndIf
…So my first question is, can anyone tell me what I’m doing wrong? And/Or is there some way I can have Litestep do some math like taking the screen resolution and dividing it by 2, and then subtract 27 ([R/2]-27)? That would be the best way because I could not have to do as much to make it work. ;-)
Thanks for your help,
Jonboy
My monitors are currently set to 1280x1024 and the line of code I changed to relocate this button works correctly…
*Shortcut "Internet Browser" 1253 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
…(just to clear this up before one asks, I using 1253 instead of -27 because my screen width is not 1280, but its 2560 b/c of the dual monitors) Well that works if I don’t change my screen resolution, but I like to change my resolution to accommodate what I’m working on like CAD or PhotoShop. So I wanted to create some If statements to make my life easier. Here is what I wrote…
*Shortcut "File Manager" 12 -22 spacer3.png spacer4.png .none #2TO !execute ["$FileManager$"]
If ResolutionX = 800
*Shortcut "Internet Browser" 773 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1023
*Shortcut "Internet Browser" 996 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1152
*Shortcut "Internet Browser" 1125 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1280
*Shortcut "Internet Browser" 1253 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
If ResolutionX = 1600
*Shortcut "Internet Browser" 1573 -22 spacer3.png spacer4.png .none #2TO !execute ["$Browser$"]
EndIf
…The result of this code ends up making the spacer3.png button disappear. I modlded my code after the authors code that changed the BottombarXXX.png file according to the resolution. His looked like this…
If ResolutionX = 800
*Shortcut "" 56 2 Topbar800.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar800.png .none .none #2 !None
ElseIf ResolutionX = 1024
*Shortcut "" 56 2 Topbar1024.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1024.png .none .none #2 !None
ElseIf ResolutionX = 1152
*Shortcut "" 56 2 Topbar1152.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1152.png .none .none #2 !None
ElseIf ResolutionX = 1280
*Shortcut "" 56 2 Topbar1280.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1280.png .none .none #2 !None
ElseIf ResolutionX = 1600
*Shortcut "" 56 2 Topbar1600.png .none .none #1 !None
*Shortcut "" 2 -22 Bottombar1600.png .none .none #2 !None
EndIf
…So my first question is, can anyone tell me what I’m doing wrong? And/Or is there some way I can have Litestep do some math like taking the screen resolution and dividing it by 2, and then subtract 27 ([R/2]-27)? That would be the best way because I could not have to do as much to make it work. ;-)
Thanks for your help,
Jonboy