Questions to MENU
Posted:
Tue Mar 15, 2016 5:59 pm
by byte-one
1. I found, that the 3. parameter (textcolor) from COLORSELECT only accepted, if in the COLORMENU the textcolor is CLR_BLACK! Please try:
- Code: Select all Expand view
COLORMENU CLR_RED,CLR_WHITE COLORSELECT CLR_BLACK,CLR_RED,CLR_HGREEN
2. Another question to the parameters from COLORSELECT: Whats the meaning from the first parameter?
3. On the top-menu the selected items i cannot change the colors!
Is a documentation for all options from this class?
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 6:26 pm
by cnavarro
Günther, excuse my poor English
Please, in the following example, tell me your questions and doubts ( Menu0002.prg and menu0002.rc )
- Code: Select all Expand view
// Autor: Cristobal Navarro
// Fecha: 01/01/2016
// Pruebas de Menus
//
#include "FiveWin.ch"
#include "wcolors.ch"
//----------------------------------------------------------------------------//
static oWnd
static oMru1
static oMru2
Static cColorPan
Static oFontMenu
//----------------------------------------------------------------------------//
function Main()
local oBar, oBar1, oBar2
local cTitle, x
Local cFont := "Segoe UI Symbol" // SemiBold" //"Calibri"
Local cFontH := -14
Local aFonts
FW_SetUnicode( .T. )
SetResDebug( .T. )
if !IsWin8() .and. !IsWindows10()
cFont := "Calibri"
endif
DEFINE FONT oFontMenu NAME cFont SIZE 0, cFontH WEIGHT 300
cTitle := " Menus: " + ;
if( !Empty( oFontMenu ), oFontMenu:cFaceName, "Font not defined " ) +;
if( !Empty( oFontMenu ), Str( oFontMenu:nHeight ), " " )
DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 MDI ;
TITLE cTitle MENU BuildMenu() COLOR CLR_WHITE, RGB( 116, 149, 193 )
//oWnd:SetFont( oFontMenu )
ACTIVATE WINDOW oWnd MAXIMIZED
if !Empty( oFontMenu )
While oFontMenu:nCount > 0
oFontMenu:End()
Enddo
endif
if File( "checkres.txt" )
FErase( "checkres.txt" )
endif
CheckRes()
return nil
//----------------------------------------------------------------------------//
Function BuildMenu( oW )
Local oMenu
Local oMnu
Local oGraba
Local cPrompt := " "
DEFAULT oW := oWnd
MENU oMenu 2015 FONT oFontMenu
MENUITEM FILE "..\bitmaps\menu4.bmp"
MENU
MENUITEM "&Nuevo" CHECKED
MENUITEM "&Open" CHARICON "A" ITALIC
SEPARATOR
MENUITEM "&1.- Item 1" RESOURCE "icon" DISABLED
MENUITEM "&2.- Item 2" CHARICON 58020 COLORRIGHT CLR_YELLOW
MENUITEM "&3.- Item 3" CHARICON 57696 BOLD ITALIC
MENUITEM "&4.- Item 4" CHARICON 57756 COLORRIGHT CLR_HRED
MENUITEM "&5.- Item 5" CHARICON 57736 COLORRIGHT CLR_MAGENTA
ENDMENU
MENUITEM "&Archivos" COLORMENU CLR_BLUE ITALIC
MENU
MENUITEM "&Nuevo item Mru" CHECKED
//SEPARATOR
MENUITEM SEPARATOR FILE "..\bitmaps\menu4.bmp"
//SEPARATOR
MENUITEM "&Files " COLORRIGHT CLR_HBLUE
MENU
MENUITEM "&Nuevo" CHECK
MENUITEM "&Open" CHARICON "A" ITALIC
MENUITEM SEPARATOR RESOURCE "Menu4"
MENUITEM "&Nuevo proceso" CHARICON "P" RIGHTCOLOR CLR_HRED BOLD
ENDMENU
MENUITEM "&New " CHARICON 57696
MENUITEM "&Child " RESOURCE "new" BOLD
SEPARATOR
MENUITEM "&Salir" ACTION oWnd:End() COLORRIGHT CLR_HRED BOLD ITALIC
ENDMENU
MENUITEM "E&ditar" COLORMENU CLR_RED BOLD
MENU
MENUITEM "&Nuevo" CHECKED
MENUITEM "&Open" CHARICON "A" ITALIC
SEPARATOR
MENUITEM "&PPPPPPPP" SEPARATOR FILE "..\bitmaps\yellow.bmp"
SEPARATOR
MENUITEM "&1.- Item 1" RESOURCE "icon" DISABLED
MENUITEM "&2.- Item 2" CHARICON 58020 COLORRIGHT CLR_YELLOW
MENUITEM "&3.- Item 3" CHARICON 57696 BOLD ITALIC
MENUITEM "&4.- Item 4" CHARICON 57756 COLORRIGHT CLR_HRED
MENUITEM "&5.- Item 5" CHARICON 57736 COLORRIGHT CLR_MAGENTA
SEPARATOR
MENUITEM "&Grabar como." CHARICON 57605
SEPARATOR
MENUITEM FILE "..\bitmaps\yellow.bmp"
ENDMENU
MENUITEM "&Buscar" COLORMENU CLR_GREEN
MENU
MENUITEM "&Nuevo" CHECKED
MENUITEM "&PPPPPPPP" SEPARATOR FILE "..\bitmaps\yellow.bmp"
MENUITEM "&Open" CHARICON "A"
SEPARATOR
MENUITEM "Uno" RESOURCE "icon" DISABLED
MENUITEM "Dos" WHEN .F. CHARICON 58020
MENUITEM "* SEPARATOR" + CRLF + "- Linea 2 " SEPARATOR COLORRIGHT CLR_HBLUE
MENUITEM "Tres" CHARICON 57696 COLORRIGHT CLR_GREEN
MENUITEM "Cuatro" CHARICON 57756 BOLD
MENUITEM "Cinco" CHARICON 57736 BOLD ITALIC
SEPARATOR
MENUITEM "&Grabar como." CHARICON 57605
MENUITEM FILE "..\bitmaps\yellow.bmp"
ENDMENU
MENUITEM "&Modificar" COLORMENU CLR_BROWN BOLD ITALIC
MENU
MENUITEM "&Nuevo proceso" CHARICON "P"
SEPARATOR
MENUITEM "&Abrir" + CRLF + "Linea 2" CHARICON "W" COLORRIGHT CLR_BLUE BOLD
MENUITEM "&Nuevo" CHECKED DISABLED
MENUITEM "SEPARATOR" + CRLF + "Linea 2" SEPARATOR BOLD ITALIC COLORRIGHT CLR_HRED
MENUITEM "&Grabar como." RESOURCE "icon"
ENDMENU
//oMenu:AddEdit()
//oMenu:AddMdi()
oMenu:AddFile()
oMenu:AddHelp( "FiveWin Menus", "FiveTech 1993-2015" )
ENDMENU
Return oMenu
//----------------------------------------------------------------------------//
File .rc
- Code: Select all Expand view
#include <windows.h>
#include <commctrl.h>
New BITMAP "..//bitmaps/16x16/new.bmp"
Dialog BITMAP "..//bitmaps/16x16/form.bmp"
Open BITMAP "..//bitmaps/16x16/open.bmp"
Save BITMAP "..//bitmaps/16x16/floppy.bmp"
Exit BITMAP "..//bitmaps/16x16/exit.bmp"
Menu4 BITMAP "..//bitmaps/menu4.bmp"
icon BITMAP "..//bitmaps/16x16/icon.bmp"
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 6:49 pm
by cnavarro
Please, in previous sample try with this modifications
- Code: Select all Expand view
MENU oMenu FONT oFnt ;
COLORMENU CLR_WHITE, CLR_BLUE ;
COLORSELECT CLR_RED, CLR_WHITE, CLR_BROWN ;
2013 NOBORDER
- Code: Select all Expand view
MENU oMenu FONT oFnt ;
COLORMENU CLR_WHITE, CLR_BLUE ;
COLORSELECT CLR_WHITE, CLR_WHITE, CLR_BROWN ;
2013 NOBORDER
Third parameter of COLORSELECT is text of item selected
COLORSELECT CLR_RED, CLR_WHITE,
CLR_BROWN ;
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 7:02 pm
by byte-one
With COLORMENU CLR_RED,
CLR_WHITE COLORSELECT CLR_BLACK,CLR_RED,CLR_HGREEN -> WRONG -> no green text!
With COLORMENU CLR_RED,
CLR_BLACK COLORSELECT CLR_BLACK,CLR_RED,CLR_HGREEN -> OK
What the first parameter from COLORSELECT?
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 7:04 pm
by byte-one
I use without any style! Is this required?
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 7:05 pm
by cnavarro
byte-one wrote:I use without any style! Is this required?
Yes
2013 style is the only style that is fully configurable by the user
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 7:25 pm
by byte-one
Now is ok but the background in child-menus is gray. Can i change this?
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 7:40 pm
by cnavarro
Ok, I will look with detail
Regards
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 8:35 pm
by byte-one
Oh, thanks, now is ok!
For the left side i use additional COLORLEFT COL,COL
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 8:42 pm
by cnavarro
byte-one wrote:Oh, thanks, now is ok!
For the left side i use additional COLORLEFT COL,COL
Yes, look
[ <left: COLORBMP, COLORLEFT, LEFTCOLOR>
[ <nClrToBa>, ] <nClrBkBa> ] ; // only background, not put nClrToBa
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 8:54 pm
by byte-one
Only background-color is not functioning!
Re: Questions to MENU
Posted:
Tue Mar 15, 2016 8:55 pm
by cnavarro
Yes, bug detected
Please, change in menu.ch
[ <oObjMenu> := ] MenuBegin( <.popup.>,, <oCtrl>, <.l2007.>, <.l2010.>,,; //<.lUnicode.>
<nClrMenu>, <nClrMenutxt>, ;
<nClrBkBa>, <nClrToBa>, <nClrHiLi>, <nClrHiLf>, ;
<nClrHitx>, <nClrHiBr>, <.lMenuBar.>, <oFont>, ;
<.lColors.>, <.lVert.>, <.l2013.>, <.l2015.>, ;
[!<.lNoBorder.>], <nClrToBr> ,<nClrBkBr>, <nRightSp>,;
<nFactor>, <nHeight>, [!<.lInherit.>], <.lInvert.>,;
<nRound>, <.lUpper.> ) // lUpper is implemented in next version