AppBar problem (Rev 3.5.0)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
AppBar problem (Rev 3.5.0)
First, please excuse my ancient version of Revolution(3.5.0) here. Couldn't afford to upgrade beyond that(though I wish I could have). Second, this isn't necessarily a problem that Rev caused, it's kind of by my own doing in what and how I'm trying to accomplish my goal.
I'm making a menu program launching AppBar with Rev 3.5 and an external exe file that I send command line params to. The command line program takes in the windows id of my rev made menu bar and then makes it an AppBar. I've actually make my command line program in two different languages while doing this because I thought my problem was with my command line program and not Rev. Turns out it was Rev. Anyway, turning the rev made menu bar into an AppBar works just fine, desktop icons move down out of the way, maximize windows are below my window and not under or over it etc. The problem is when I click a menu and it opens... there's a huge gap between the menu bar and the menu itself. I've exhausted myself trying to find out what's wrong or a way around it.
Here's a screenshot:
Is there a way that I can tell the menu to move up some pixels when it's clicked? My knowledge of Rev is a bit rusty and I did look through the docs in hopes of finding a solution.
Any help is appreciated(this gap between menu and bar is the only thing holding me back now on this program).
Thanks in advance,
~Garrett
I'm making a menu program launching AppBar with Rev 3.5 and an external exe file that I send command line params to. The command line program takes in the windows id of my rev made menu bar and then makes it an AppBar. I've actually make my command line program in two different languages while doing this because I thought my problem was with my command line program and not Rev. Turns out it was Rev. Anyway, turning the rev made menu bar into an AppBar works just fine, desktop icons move down out of the way, maximize windows are below my window and not under or over it etc. The problem is when I click a menu and it opens... there's a huge gap between the menu bar and the menu itself. I've exhausted myself trying to find out what's wrong or a way around it.
Here's a screenshot:
Is there a way that I can tell the menu to move up some pixels when it's clicked? My knowledge of Rev is a bit rusty and I did look through the docs in hopes of finding a solution.
Any help is appreciated(this gap between menu and bar is the only thing holding me back now on this program).
Thanks in advance,
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: AppBar problem (Rev 3.5.0)
A couple of things. You can use the community edition of the latest LiveCode for free. The issue may have been solved already, if the problem is the version you're using. It's pretty ancient and operating systems have changed a lot since then.
You don't say how you are creating the menus. Are the buttons menu button pulldowns? Popup buttons? Fields you've created? Stack menus? We'd need to know that, and also we'd probably need to see a script segment that will give us some idea of how the menus are created and displayed.
You don't say how you are creating the menus. Are the buttons menu button pulldowns? Popup buttons? Fields you've created? Stack menus? We'd need to know that, and also we'd probably need to see a script segment that will give us some idea of how the menus are created and displayed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: AppBar problem (Rev 3.5.0)
Can I distribute programs I make with LiveCode Community Edition as shareware?
Here's the properties of the elements used for the menu:
And the code for generating the menus.
Thanks a bunch,
~Garrett
Here's the properties of the elements used for the menu:
Code: Select all
set the systemWindow of me to true
set the decorations of this stack to empty
Code: Select all
Group of Buttons
Group properties
Visible
ThreeD
Select grouped controls
Hilite one radio button at a time
Contents focus with keyboard
Behave like a background
Buttons properties
Type: Pull Down
Access with mouse button: 1
Opaque
Display Name
(Has Menu Items)
Code: Select all
on subGenerateMenus
lock screen
subDeleteMenus
put URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/AppMenu.list") into varMenusData
if varMenusData is empty then
create folder specialfolderpath(0x001a) & "/AppMenu"
put "Calculator" & tab & "calc.exe" & cr into varTempData
put "Notepad" & tab & "notepad.exe" & cr after varTempData
put "Windows Explorer" & tab & "explorer.exe" & cr after varTempData
put "Wordpad" & tab & "write.exe" after varTempData
put varTempData into URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/Accessories.menu")
put "Paint" & tab & "mspaint.exe" & cr into varTempData
put varTempData into URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/Graphics.menu")
put "Control Panel" & tab & "control.exe" & cr into varTempData
put "Console Window" & tab & "cmd.exe" & cr after varTempData
put varTempData into URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/System.menu")
put "Accessories" & cr & "Graphics" & cr & "System" into varMenusData
put varMenusData into URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/AppMenu.list")
put "1" into varFirstStart
end if
-- Now generate the menus on the menubar
set the itemdel to tab
put 1 into varLoopCounter
put number of lines of varMenusData into varLoopEnd
put the id of button "MenuTemplate" into varTempButton
set the visible of button ID varTempButton to true
put "Appmenu" into varLastMenuName
repeat until varLoopCounter > the number of lines of varMenusData
put line varLoopCounter of varMenusData into varCurrentMenuName
put URL ("file:" & specialfolderpath(0x001a) & "/AppMenu/" & varCurrentMenuName & ".menu") into varCurrentMenuData
put the right of button varLastMenuName into varLeftExtent
set the name of the first button to varCurrentMenuName
set the label of the first button to varCurrentMenuName
copy button varCurrentMenuName to group "Menubar 1"
set the name of the first button to "MenuTemplate"
set the label of the first button to "MenuTemplate"
set the width of button varCurrentMenuName to (the formattedwidth of button varCurrentMenuName + 4)
set the left of button varCurrentMenuName to varLeftExtent
set the top of button varCurrentMenuName to the top button "Appmenu"
put varCurrentMenuName into varLastMenuName
put 1 into varMenuLoopCounter
put line varMenuLoopCounter of varCurrentMenuData into varCurrentLine
repeat until varMenuLoopCounter > the number of lines of varCurrentMenuData
--answer varCurrentLine
put the first item of varCurrentLine & cr after varCurrentMenuItems
--answer varCurrentMenuItems
put varMenuLoopCounter + 1 into varMenuLoopCounter
put line varMenuLoopCounter of varCurrentMenuData into varCurrentLine
end repeat
put varCurrentMenuItems into button varCurrentMenuName
put empty into varCurrentMenuItems
put varLoopCounter + 1 into varLoopCounter
end repeat
set the visible of button ID varTempButton to false
put funcScreenWidth(varNull) into varWidth
set the left of group "Menubar 1" to 0
set the width of group "Menubar 1" to funcScreenWidth(varNull)
set the left of group "Menubar 1" to 0
set the top of group "Menubar 1" to 0
unlock screen
end subGenerateMenus
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Re: AppBar problem (Rev 3.5.0)
Just tried the latest LiveCode Community Edition and the effect is still present.
~Garrett
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: AppBar problem (Rev 3.5.0)
Hey Garrett, I'm not sure about your menu woes, but I can tell you that you can distribute any software you create with the community edition under a GPL(v3) license.
http://www.gnu.org/licenses/gpl-3.0.html
http://www.gnu.org/licenses/gpl-3.0.html
Re: AppBar problem (Rev 3.5.0)
sefrojonesGAda40 wrote:Hey Garrett, I'm not sure about your menu woes, but I can tell you that you can distribute any software you create with the community edition under a GPL(v3) license.
http://www.gnu.org/licenses/gpl-3.0.html
Thanks for the info
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: AppBar problem (Rev 3.5.0)
Thanks for the info. I made a quick systemwindow with a simple group containing 3 pulldown buttons with the same properties as yours. On OS X, there is no gap between the menu display and the menu button. Since you're on Windows, it may be a bug in that implementation, or something specific to your script (though I don't see anything after a quick read.)
I'll enclose my test stack. See if it works correctly for you on Windows. That would at least give us some idea where to start looking for the problem. One thing I did notice is that, at least on Mac, setting the stack decorations after the systemwindow is set will cause the systemwindow setting to revert back to false. On Mac you'd need to swap the order of those two lines.
The enclosed was made in LC 6.6.2 and will not open in your old version, you'll need to look in the latest. Also, I forgot to set the decorations on it to empty but I did test to see if that made a difference and on Mac it didn't.
I'll enclose my test stack. See if it works correctly for you on Windows. That would at least give us some idea where to start looking for the problem. One thing I did notice is that, at least on Mac, setting the stack decorations after the systemwindow is set will cause the systemwindow setting to revert back to false. On Mac you'd need to swap the order of those two lines.
The enclosed was made in LC 6.6.2 and will not open in your old version, you'll need to look in the latest. Also, I forgot to set the decorations on it to empty but I did test to see if that made a difference and on Mac it didn't.
- Attachments
-
- systemMenuTest.livecode.zip
- (847 Bytes) Downloaded 228 times
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: AppBar problem (Rev 3.5.0)
I'm sorry Jacqueline, I hope I didn't mislead you in my first post... But, I am using an external program to act as a middle man between my Rev program and the windows API system to create the appbar space at the top of my screen.
Basically, Windows will reserve the amount of space you tell it on any given side of the screen for your program so that no other programs can be maximized over it or rest over it. Like the Windows Taskbar. Basically I'm making what is called an AppBar which is similar in some aspects to the old MacBar of the old Mac systems, where the bar at top is reserved and cannot be covered up. Except with mine I'm simply using it to launch programs, documents, links and anything else that can be launched.
Now, if I do not ask the Windows system to give this permission and property to my Rev program, the menu works just fine with no gap, but the moment I activate the call to the Windows system, my Rev program is placed in the reserved space on the desktop and is then like the Windows task bar, but when I do this, the drop down menus then have the gap between the menu bar and the drop down menus.
It is some sort of side effect that so far only happens when I use Rev. I've used this method using a few other programming languages, but they do not suffer the side effect. I was hoping though that there would be a way for me to set the properties of the menus that drop down from the menu so that I could remove the gap and bring the dropped down menus backup where they belong.
This isn't exactly a problem with Revolution itself but merely a side effect of me doing something that isn't native to Revolution, or more correctly, it's a Garrett made problem. I would love to finish this project using Rev(or LiveCode) due to the customization I could I do, but will not be completely put off if there is no solution to this.
In fact, if you have Windows available I would be more than happy to zip up the files for you to try. But it is Windows specific. I would also ask that you not laugh at my poor Rev coding skills.
Thanks,
~Garrett
Basically, Windows will reserve the amount of space you tell it on any given side of the screen for your program so that no other programs can be maximized over it or rest over it. Like the Windows Taskbar. Basically I'm making what is called an AppBar which is similar in some aspects to the old MacBar of the old Mac systems, where the bar at top is reserved and cannot be covered up. Except with mine I'm simply using it to launch programs, documents, links and anything else that can be launched.
Now, if I do not ask the Windows system to give this permission and property to my Rev program, the menu works just fine with no gap, but the moment I activate the call to the Windows system, my Rev program is placed in the reserved space on the desktop and is then like the Windows task bar, but when I do this, the drop down menus then have the gap between the menu bar and the drop down menus.
It is some sort of side effect that so far only happens when I use Rev. I've used this method using a few other programming languages, but they do not suffer the side effect. I was hoping though that there would be a way for me to set the properties of the menus that drop down from the menu so that I could remove the gap and bring the dropped down menus backup where they belong.
This isn't exactly a problem with Revolution itself but merely a side effect of me doing something that isn't native to Revolution, or more correctly, it's a Garrett made problem. I would love to finish this project using Rev(or LiveCode) due to the customization I could I do, but will not be completely put off if there is no solution to this.
In fact, if you have Windows available I would be more than happy to zip up the files for you to try. But it is Windows specific. I would also ask that you not laugh at my poor Rev coding skills.
Thanks,
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: AppBar problem (Rev 3.5.0)
Ah, okay, it all becomes clear now. I don't think I need to see your stack, I think I know the reason for the problem. Internally, LC creates separate, temporary window structures to simulate menus that are attached to buttons. Since the external app prevents other windows from entering its reserved space, the menu windows LC creates can't enter it either and are appearing below the bottom boundary.
This is the same reason LC popup menus didn't work on mobile at first either; mobile devices can only have a single window on screen at a time. The engine was revised for mobile, but I don't think the engineers expected anything like this on desktop.
I don't know how the external program works exactly, but if you can designate a shorter height as the reserved space you might be able to fake it. If the reserved space is exactly the same height as your app bar, then I'm guessing the menus would theoretically appear just below that. Maybe.
This is the same reason LC popup menus didn't work on mobile at first either; mobile devices can only have a single window on screen at a time. The engine was revised for mobile, but I don't think the engineers expected anything like this on desktop.
I don't know how the external program works exactly, but if you can designate a shorter height as the reserved space you might be able to fake it. If the reserved space is exactly the same height as your app bar, then I'm guessing the menus would theoretically appear just below that. Maybe.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: AppBar problem (Rev 3.5.0)
Exactly, and that was what I was thinking the problem might be.
I do not know exactly what the process is for the windows api call. I merely send the windows ID(or Hwnd) of the program I want to use as an appbar, what location, top, bottom, left or right and the amount of space I need and the other program I made makes the call to the windows system.
Thanks for the info and help. I'll try a few experiments and see if I can come up with some work around.
~Garrett
I do not know exactly what the process is for the windows api call. I merely send the windows ID(or Hwnd) of the program I want to use as an appbar, what location, top, bottom, left or right and the amount of space I need and the other program I made makes the call to the windows system.
Thanks for the info and help. I'll try a few experiments and see if I can come up with some work around.
~Garrett
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: AppBar problem (Rev 3.5.0)
Since you can tell it the amount of space you need, try making the reserved height the same as the stack height.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com