FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH/xHarbour Menus
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH/xHarbour Menus
Posted: Wed May 27, 2009 08:41 AM

Stefan, Evans,

Simply change FARPROC into WNDPROC in the C code section :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 114
Joined: Tue Feb 14, 2006 08:13 AM
Re: FWH/xHarbour Menus
Posted: Wed May 27, 2009 04:07 PM
Antonio hi,
Can you please take a look at my modified MENUS.C, regarding this annoying HCYAN
background color under the selected menuitem?
I would really be obliged if you find some solution.

Thanks a million times...
Kind regards
Evans

Antonio Linares wrote:Stefan, Evans,

Simply change FARPROC into WNDPROC in the C code section :-)
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: FWH/xHarbour Menus
Posted: Thu May 28, 2009 06:47 AM
Antonio,

Antonio Linares wrote:Stefan, Evans,
Simply change FARPROC into WNDPROC in the C code section :-)


thanks, it compiles fine now.
kind regards

Stefan
Posts: 114
Joined: Tue Feb 14, 2006 08:13 AM
Re: FWH/xHarbour Menus
Posted: Thu May 28, 2009 05:50 PM
Stefan,
Post an image when you try the program...
Thanks and regards
Evans


StefanHaupt wrote:Antonio,

Antonio Linares wrote:Stefan, Evans,
Simply change FARPROC into WNDPROC in the C code section :-)


thanks, it compiles fine now.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH/xHarbour Menus
Posted: Thu May 28, 2009 10:49 PM
Evans,

You just need this new line:
Code (fw): Select all Collapse
            ...  
            if( !bTab )
            {
                     // V. ADDED STARTS
               if( ! ( lpdis->itemState & ODS_SELECTED ) )  // NEW !!!!!!!!
                  SetBkColor( lpdis->hDC, 16770508 );      // HCYAN1
                     // V. ADDED ENDS

               DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_LEFT );
               ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 114
Joined: Tue Feb 14, 2006 08:13 AM
Re: FWH/xHarbour Menus
Posted: Fri May 29, 2009 02:34 PM
Antonio Linares wrote:Evans,

You just need this new line:
Code (fw): Select all Collapse
            ...  
            if( !bTab )
            {
                     // V. ADDED STARTS
               if( ! ( lpdis->itemState & ODS_SELECTED ) )  // NEW !!!!!!!!
                  SetBkColor( lpdis->hDC, 16770508 );      // HCYAN1
                     // V. ADDED ENDS

               DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_LEFT );
               ...




Antonio hi,
It does work fine and of course, I would like to thank you very much for your help!!!



There is one more line to add the same code, where we use menuitems with Tabs,
and the change is as follows (marked with BOLD letters):

if( !bTab )
{

// V. STARTS
if( ! ( lpdis->itemState & ODS_SELECTED ) ) // NEW !!!!!!!! // THANKS TO ANTONIO !!!
SetBkColor( lpdis->hDC, 16770508 ); // HCYAN1
// V. ENDS
DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_LEFT );

// MessageBox( 0, "Debug line 11385", "Attention", 0 );

}
else
{
lpdis->rcItem.right -= 21; // THOSE THAT HAVE TABS (eg. F5)
StrToken( szPrompt, 1, 9, &wLen ); // 32 bits does not fill wLen before
// V. STARTS
if( ! ( lpdis->itemState & ODS_SELECTED ) ) // NEW !!!!!!!! // THANKS TO ANTONIO !!!
SetBkColor( lpdis->hDC, 16770508 );
// V. ENDS
DrawText( lpdis->hDC, StrToken(szPrompt, 1, 9, &wLen), wLen, &lpdis->rcItem, DT_LEFT );

StrToken( szPrompt, 2, 9, &wLen ); // 32 bits does not fill wLen before

DrawText( lpdis->hDC, StrToken(szPrompt, 2, 9, &wLen), wLen, &lpdis->rcItem, DT_RIGHT );
lpdis->rcItem.right += 21;
}

It now works nicely, and of course, our FW users can definitely offer something different to their clients,
considering that the above color used in my screens (and your example) [color 16770508, which is close
to HCYAN] can be changed to anything that the users like (can even be selected by the clients if they want).

Once again, I would like to express my many thanks to you and everyone else involved into these (both
the menu color, and the dialogs' background brush).

Thank You!

Long Live FWH !

My kindest regards
Evans

ps. For Otto... I will soon be involved with the tooltips for menus, in hopes that I can do it...

For anyone else concerned...
The balloon tooltips, do NOT work on Win XP Prof., not in the buttonbar, and not on buttons, classic or
buttonbmp's. I experienced this problem this morning; just one of my clients has this Win version.
Anybody else having resolved this issued (the program works on 3 workstations, 1 of them is XP Home,
another is Vista, and the last one is Win XP Prof. The XP Prof does not display tooltips at all, however,
the menuitem messages were displayed fine on the status bar).

Continue the discussion