Python win32con.BN_CLICKED Examples

The following are 20 code examples of win32con.BN_CLICKED(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module win32con , or try the search function .
Example #1
Source File: winguiauto.py    From pyAutoTrading with GNU General Public License v2.0 6 votes vote down vote up
def clickButton(hwnd):
    """Simulates a single mouse click on a button

    Parameters
    ----------
    hwnd
        Window handle of the required button.

    Usage example::

        okButton = findControl(fontDialog,
                               wantedClass="Button",
                               wantedText="OK")
        clickButton(okButton)
    """
    _sendNotifyMessage(hwnd, win32con.BN_CLICKED) 
Example #2
Source File: winguiauto.py    From pyautotrade_tdx with GNU General Public License v2.0 6 votes vote down vote up
def clickButton(hwnd):
    '''Simulates a single mouse click on a button

    Parameters
    ----------
    hwnd
        Window handle of the required button.

    Usage example::

        okButton = findControl(fontDialog,
                               wantedClass="Button",
                               wantedText="OK")
        clickButton(okButton)
    '''
    _sendNotifyMessage(hwnd, win32con.BN_CLICKED) 
Example #3
Source File: winguiauto.py    From PyAutoTrading with GNU General Public License v2.0 6 votes vote down vote up
def clickButton(hwnd):
    '''Simulates a single mouse click on a button

    Parameters
    ----------
    hwnd
        Window handle of the required button.

    Usage example::

        okButton = findControl(fontDialog,
                               wantedClass="Button",
                               wantedText="OK")
        clickButton(okButton)
    '''
    _sendNotifyMessage(hwnd, win32con.BN_CLICKED) 
Example #4
Source File: winguiauto.py    From pyautotrade_tdx with GNU General Public License v2.0 6 votes vote down vote up
def clickButton(hwnd):
    '''Simulates a single mouse click on a button

    Parameters
    ----------
    hwnd
        Window handle of the required button.

    Usage example::

        okButton = findControl(fontDialog,
                               wantedClass="Button",
                               wantedText="OK")
        clickButton(okButton)
    '''
    _sendNotifyMessage(hwnd, win32con.BN_CLICKED) 
Example #5
Source File: toolmenu.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def OnButtonMove(self, id, cmd):
		if cmd==win32con.BN_CLICKED:
			try:
				itemNo = self.listControl.GetNextItem(-1, commctrl.LVNI_SELECTED)
			except win32ui.error:
				return
			menu = self.listControl.GetItemText(itemNo, 0)
			cmd = self.listControl.GetItemText(itemNo, 1)
			if id == win32ui.IDC_BUTTON1:
				# Move up
				if itemNo > 0:
					self.listControl.DeleteItem(itemNo)
					# reinsert it.
					self.listControl.InsertItem(itemNo-1, menu)
					self.listControl.SetItemText(itemNo-1, 1, cmd)
			else:
				# Move down.
				if itemNo < self.listControl.GetItemCount()-1:
					self.listControl.DeleteItem(itemNo)
					# reinsert it.
					self.listControl.InsertItem(itemNo+1, menu)
					self.listControl.SetItemText(itemNo+1, 1, cmd) 
Example #6
Source File: toolmenu.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButtonNew(self, id, cmd):
		if cmd==win32con.BN_CLICKED:
			newIndex = self.listControl.GetItemCount()
			self.listControl.InsertItem(newIndex, "Click to edit the text")
			self.listControl.EnsureVisible(newIndex, 0) 
Example #7
Source File: win32_helper.py    From pySPM with Apache License 2.0 5 votes vote down vote up
def clickButton(hwnd):
    _sendNotifyMessage(hwnd, win32con.BN_CLICKED) 
Example #8
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButEdgeColor(self, id, code):
		if code == win32con.BN_CLICKED:
			d = win32ui.CreateColorDialog(self.edgeColor, 0, self)
			# Ensure the current color is a custom color (as it may not be in the swatch)
			# plus some other nice gray scales.
			ccs = [self.edgeColor]
			for c in range(0xef, 0x4f, -0x10):
				ccs.append(win32api.RGB(c,c,c))
			d.SetCustomColors( ccs )
			if d.DoModal() == win32con.IDOK:
				self.edgeColor = d.GetColor()
				self.UpdateUIForState() 
Example #9
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButSimple(self, id, code):
		if code == win32con.BN_CLICKED:
			self.UpdateUIForState() 
Example #10
Source File: toolmenu.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButtonDelete(self, id, cmd):
		if cmd==win32con.BN_CLICKED:
			try:
				itemNo = self.listControl.GetNextItem(-1, commctrl.LVNI_SELECTED)
			except win32ui.error: # No selection!
				return
			self.listControl.DeleteItem(itemNo) 
Example #11
Source File: dlgtest.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnInitDialog(self):
		# We use the HookNotify function to allow Python to respond to
		# Windows WM_NOTIFY messages.
		# In this case, we are interested in BN_CLICKED messages.
		self.HookNotify(self.OnNotify, win32con.BN_CLICKED) 
Example #12
Source File: ideoptions.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def HandleCharFormatChange(self, id, code):
		if code == win32con.BN_CLICKED:
			editId = buttonControlMap.get(id)
			assert editId is not None, "Format button has no associated edit control"
			editControl = self.GetDlgItem(editId)
			existingFormat = editControl.GetDefaultCharFormat()
			flags = win32con.CF_SCREENFONTS
			d=win32ui.CreateFontDialog(existingFormat, flags, None, self)
			if d.DoModal()==win32con.IDOK:
				cf = d.GetCharFormat()
				editControl.SetDefaultCharFormat(cf)
				self.SetModified(1)
			return 0 # We handled this fully! 
Example #13
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnStyleUIChanged(self, id, code):
		if code in [win32con.BN_CLICKED, win32con.CBN_SELCHANGE]:
			style = self.GetSelectedStyle()
			self.ApplyUIFormatToStyle(style)
			self.scintilla.ApplyFormattingStyles(0)
			return 0
		return 1 
Example #14
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButUseDefaultBackground(self, id, code):
		if code == win32con.BN_CLICKED:
			isDef = self.butIsDefaultBackground.GetCheck()
			self.GetDlgItem(win32ui.IDC_BUTTON4).EnableWindow(not isDef)
			if isDef: # Being reset to the default color
				style = self.GetSelectedStyle()
				style.background = CLR_INVALID
				self.UpdateUIForStyle(style)
				self.scintilla.ApplyFormattingStyles(0)
			else:
				# User wants to override default -
				# do nothing!
				pass 
Example #15
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButThisBackground(self, id, code):
		if code==win32con.BN_CLICKED:
			style = self.GetSelectedStyle()
			bg = win32api.RGB(0xff, 0xff, 0xff)
			if style.background != CLR_INVALID:
				bg = style.background
			d=win32ui.CreateColorDialog(bg, 0, self)
			if d.DoModal()==win32con.IDOK:
				style.background = d.GetColor()
				self.scintilla.ApplyFormattingStyles(0)
			return 1 
Example #16
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButUseDefaultFont(self, id, code):
		if code == win32con.BN_CLICKED:
			isDef = self.butIsDefault.GetCheck()
			self.GetDlgItem(win32ui.IDC_BUTTON3).EnableWindow(not isDef)
			if isDef: # Being reset to the default font.
				style = self.GetSelectedStyle()
				style.ForceAgainstDefault()
				self.UpdateUIForStyle(style)
				self.scintilla.ApplyFormattingStyles(0)
			else:
				# User wants to override default -
				# do nothing!
				pass 
Example #17
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButFixedOrDefault(self, id, code):
		if code==win32con.BN_CLICKED:
			bUseFixed = id == win32ui.IDC_RADIO1
			self.GetDlgItem(win32ui.IDC_RADIO1).GetCheck() != 0
			self.scintilla._GetColorizer().bUseFixed = bUseFixed
			self.scintilla.ApplyFormattingStyles(0)
			return 1 
Example #18
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButDefaultPropFont(self, id, code):
		if code==win32con.BN_CLICKED:
			self._DoButDefaultFont(win32con.CF_SCALABLEONLY, "baseFormatProp")
			return 1 
Example #19
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def OnButDefaultFixedFont(self, id, code):
		if code==win32con.BN_CLICKED:
			self._DoButDefaultFont(win32con.CF_FIXEDPITCHONLY, "baseFormatFixed")
			return 1 
Example #20
Source File: configui.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def _DoButDefaultFont(self, extra_flags, attr):
		baseFormat = getattr(self.scintilla._GetColorizer(), attr)
		flags = extra_flags | win32con.CF_SCREENFONTS | win32con.CF_EFFECTS | win32con.CF_FORCEFONTEXIST
		d=win32ui.CreateFontDialog(baseFormat, flags, None, self)
		if d.DoModal()==win32con.IDOK:
			setattr(self.scintilla._GetColorizer(), attr, d.GetCharFormat())
			self.OnStyleUIChanged(0, win32con.BN_CLICKED)