* Fixed toolbar button pressing - This required for HwndWrapper.NotifyParent() to be updated (to accept a new ID parameter)

This commit is contained in:
markm 2007-06-13 18:26:00 +00:00
parent a1ed80c1c5
commit 9aab1b8549
2 changed files with 18 additions and 9 deletions

@ -628,12 +628,15 @@ class HwndWrapper(object):
# #
#----------------------------------------------------------- #-----------------------------------------------------------
def NotifyParent(self, message): def NotifyParent(self, message, controlID = None):
"Send the notification message to parent of this control" "Send the notification message to parent of this control"
if controlID is None:
controlID = self.ControlID()
return self.Parent().PostMessage( return self.Parent().PostMessage(
win32defines.WM_COMMAND, win32defines.WM_COMMAND,
win32functions.MakeLong(message, self.ControlID()), win32functions.MakeLong(message, controlID),
self) self)
#----------------------------------------------------------- #-----------------------------------------------------------

@ -1960,10 +1960,16 @@ class ToolbarWrapper(HwndWrapper.HwndWrapper):
button = self.GetButton(button_index) button = self.GetButton(button_index)
ret = self.SendMessageTimeout( # transliterated from
win32defines.TB_PRESSBUTTON, # http://source.winehq.org/source/dlls/comctl32/toolbar.c
button.idCommand,
win32functions.MakeLong(0, 1)) # if the button is enabled
if button.IsEnabled():
ret = self.NotifyParent(
#win32defines.TB_PRESSBUTTON,
message = win32defines.BN_CLICKED,
controlID = button.idCommand)
win32functions.WaitGuiThreadIdle(self) win32functions.WaitGuiThreadIdle(self)
time.sleep(Timings.after_toobarpressbutton_wait) time.sleep(Timings.after_toobarpressbutton_wait)