Answered by:
COLOR SCHEME not working in MENU

Question
-
**Consider following code:-
CLEAR
SET SYSMENU SAVE
SET SYSMENU TO
SET COLOR TODEFINE PAD main1 OF _MSYSMENU PROMPT 'Option-01'
DEFINE PAD main2 OF _MSYSMENU PROMPT 'Option-02'
DEFINE PAD main3 OF _MSYSMENU PROMPT 'Option-03'
DEFINE PAD main4 OF _MSYSMENU PROMPT 'Option-04'ON PAD main1 OF _MSYSMENU ACTIVATE POPUP pran1
DEFINE POPUP pran1 MARGIN RELATIVE SHADOW COLOR SCHEME 1
DEFINE BAR 1 OF pran1 PROMPT 'New '
DEFINE BAR 2 OF pran1 PROMPT 'Open '
DEFINE BAR 3 OF pran1 PROMPT 'Close '
ON SELECTION POPUP pran1 wait windowON PAD main2 OF _MSYSMENU ACTIVATE POPUP pran2
DEFINE POPUP pran2 MARGIN RELATIVE SHADOW COLOR SCHEME 2
DEFINE BAR 1 OF pran2 PROMPT 'ABCDEF'
DEFINE BAR 2 OF pran2 PROMPT 'aieou'
DEFINE BAR 3 OF pran2 PROMPT 'aabbccdd'
ON SELECTION POPUP pran2 wait window**
** & So On
READ EVENTS
SET SYSMENU TO DEFAULT
CANCEL
My problem is that : I have used different color scheme (i.e. COLOR SCHEME 1 , COLOR SCHEME 2) in different POPUPS but colors displayed on click of Option-01 or Option-03 or Option-03 is same always (white background, black text).
How to change the color scheme? Just to display different color POPUPS on clicking on different options.
Sunday, May 5, 2013 12:54 PM
Answers
-
Maybe you should read this paper: http://doughennig.com/papers/..%5CPub%5CCoolControls.pdf
- Marked as answer by Pranay R Singh Monday, May 6, 2013 6:07 PM
Monday, May 6, 2013 5:56 PM -
If the VCX_tool does not work then you have to debug it or ask its author for help.
Colors work for me in VFP. Following code
DEFINE BAR 1 OF pran1 PROMPT 'New ' COLOR ,RGB(255,128,128,0,0,0)
displays red text on black background.
Or do you need something else?
- Edited by Pavel Celba Monday, May 6, 2013 4:37 PM
- Marked as answer by Pranay R Singh Monday, May 6, 2013 4:55 PM
Monday, May 6, 2013 4:36 PM
All replies
-
Menu colors are derived from Windows by default. You may try to switch Windows Themes off.
See _screen.Themes and SYS(2700) in VFP help.
- Proposed as answer by Naomi N Sunday, May 5, 2013 6:11 PM
Sunday, May 5, 2013 6:07 PM -
Menu color settings are a holdover from DOS days and are not supported on Windows. In Windows, menus pick up the users settings from Windows settings.
Craig Berntson
MCSD, Visual C# MVP
INETA Community Speaker
www.craigberntson.comMonday, May 6, 2013 2:21 PM -
Dear Pavel,
I have got some stuff on Net thru which I got menu colors on my own:-
SET SYSMENU SAVE
SET SYSMENU TO
DEFINE PAD main1 OF _MSYSMENU PROMPT 'Option-01'
DEFINE PAD main2 OF _MSYSMENU PROMPT 'Option-02'ON SELECTION PAD main1 of _msysmenu do SHOW1
ON SELECTION PAD main2 of _msysmenu do SHOW2FUNCTION Show1
loPop = newobject('PopMenu', 'VCX_Tool.vcx')
with loPop
.nMenuBackColor = Rgb(225,255,255)
.nItemHeight = 26.nBarStyle = 2
.nBarWidth = 30
.nBarFillColor1 = Rgb(192,251,247)
.nBarFillColor2 = Rgb(0,0,255)
.nTextLeft = 30
.nTextMargin = 8.nSelectedStyle = 2
.lSelectedEnabled = .T.
.nSelectedBackColor = Rgb(100, 250, 255)
.nSelectedForeColor = Rgb( 0, 0, 255)
.nReturn = 2
.lOwnerDraw = .T..Add('', '', 'New', '', '')
&& ParentKey, Key, Caption, Command, Image
.Add('', '', 'Open', '', '')
.Add("", "", "Close", "", '')
.Add("", "", "Edit", "", '')
.Add("", "", "Delete", "", '', .F.)
.Add('', '', '\-')
.Add("", "", "Exit", "Cancel", '')
endwith
loPop.Show(0, 0)
RETURN
FUNCTION Show2loPop = newobject('PopMenu', 'VCX_Tool.vcx')
with loPop
.nMenuBackColor = Rgb(225,255,255)
.nItemHeight = 26.nBarStyle = 2
.nBarWidth = 30
.nBarFillColor1 = Rgb(192,251,247)
.nBarFillColor2 = Rgb(0,0,255)
.nTextLeft = 30
.nTextMargin = 8.nSelectedStyle = 2
.lSelectedEnabled = .T.
.nSelectedBackColor = Rgb(100, 250, 255)
.nSelectedForeColor = Rgb( 0, 0, 255)
.nReturn = 2
.lOwnerDraw = .T..Add('', '', 'Hello','', '')
.Add('', '', 'How Are You','','')
endwith
loPop.Show(0, 0)
RETURNNow the issue is that the POPMENU is on display only after clicking on top Options. Also I am unable to place respective POPUPs on respective click position. All POPUP starts from left most area of screen... not below the option on which I am clicking.
Please help...
I am struglling to get BAR on the left side of POPUP menus & Customize colors to the POPUPs.
Thanks
Monday, May 6, 2013 2:46 PM -
If the VCX_tool does not work then you have to debug it or ask its author for help.
Colors work for me in VFP. Following code
DEFINE BAR 1 OF pran1 PROMPT 'New ' COLOR ,RGB(255,128,128,0,0,0)
displays red text on black background.
Or do you need something else?
- Edited by Pavel Celba Monday, May 6, 2013 4:37 PM
- Marked as answer by Pranay R Singh Monday, May 6, 2013 4:55 PM
Monday, May 6, 2013 4:36 PM -
Actually I need my Menu like this:-
I hope I have asked you many things.. But I know you can help. You can have any color combination, but menu should work like above.
Thanks
- Edited by Pranay R Singh Monday, May 6, 2013 5:16 PM
Monday, May 6, 2013 5:15 PM -
Maybe you should read this paper: http://doughennig.com/papers/..%5CPub%5CCoolControls.pdf
- Marked as answer by Pranay R Singh Monday, May 6, 2013 6:07 PM
Monday, May 6, 2013 5:56 PM -
Dear Pavel,
I have gone thru all this. Everything is working fine as I mentioned earlier.
The main problem is to detect the Horizontal & Vertical location of the selected PAD positon of MainMenu so that respective POPUP can be activated & placed below the selected PAD.
How to get the location (x,y) cordinates of selected/clicked PAD ?
Thanx
- Edited by Pranay R Singh Tuesday, May 7, 2013 6:54 PM
Tuesday, May 7, 2013 6:53 PM