Can you tell me if I can find somewhere a sample code that shows how to
check/uncheck some menu items, and if it is possible to change the status
bar text when the user moves the mouse cursor through the menus?
Also, where can I find the list of events that can be handled for a Richedit
From: Robert May <rmay@po...> - 2006-11-11 01:11:40
Octavian Rasnita wrote:
> Can you tell me if I can find somewhere a sample code that shows how to
> check/uncheck some menu items,
The Draw.pl demo has examples of checked/unchecked menu items.
> and if it is possible to change the status
> bar text when the user moves the mouse cursor through the menus?
The win32-gui-demos script, distributed with 1.04 and higher has a way
to do this (it's a bit of a hack though).
From: Robert May <rmay@po...> - 2006-11-13 19:03:37
Octavian Rasnita wrote:
Please keep discussions on the list (unless they are heading off-topic),
and don't mail me directly:
(1) Others benefit from seeing the questions/answers.
(2) Others might be able to answer and save me from answering everything.
>>> and if it is possible to change the status
>>> bar text when the user moves the mouse cursor through the menus?
>> The win32-gui-demos script, distributed with 1.04 and higher has a way
>> to do this (it's a bit of a hack though).
> Where can I find that win32-gui-demos script?
> I have taken a look in the demos directory, but I couldn't find something
> helpful. Should I look elsewhere?
It's the demo launcher program distributed with Win32::GUI 1.04 and
higher. You should find it in C:\Perl\bin (or perhaps
C:\Perl\site\bin\), adjusting paths as necessary for your perl
installation. If not, then you can find it here:
> I have also seen that after changing the checked/unchecked state of a menu
> item $Win->InvalidateRect(1) is used.
> Can you tell me why? If somebody will change the state of a menu item, the
> menu closes, and the next time it is opened I think it should appear
> changed. Isn't this true?
The InvalidateRect() call has nothing to do with the menu checked state
- it's asking windows to post a WM_PAINT message to the window, as (in
this example) you've just changed the drawing mode, and want the main
window to be completely re-drawn.
> I have also seen that there is the method DrawMenuBar() which should redraw
> the menu bar only. Shouldn't it be use instead of InvalidateRect() just for
> redrawing the menu bar if it is necessary?
Correct, but that's not what's being asked for here.