Page 2 of 2

Re: FWH/xHarbour Menus

PostPosted: Wed May 27, 2009 8:41 am
by Antonio Linares
Stefan, Evans,

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

Re: FWH/xHarbour Menus

PostPosted: Wed May 27, 2009 4:07 pm
by E. Bartzokas
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 :-)

Re: FWH/xHarbour Menus

PostPosted: Thu May 28, 2009 6:47 am
by StefanHaupt
Antonio,

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


thanks, it compiles fine now.

Re: FWH/xHarbour Menus

PostPosted: Thu May 28, 2009 5:50 pm
by E. Bartzokas
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.

Re: FWH/xHarbour Menus

PostPosted: Thu May 28, 2009 10:49 pm
by Antonio Linares
Evans,

You just need this new line:
Code: Select all  Expand view

            ...  
            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 );
               ...
 

Image

Re: FWH/xHarbour Menus

PostPosted: Fri May 29, 2009 2:34 pm
by E. Bartzokas
Antonio Linares wrote:Evans,

You just need this new line:
Code: Select all  Expand view

            ...  
            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 );
               ...
 

Image



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

Image

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).