本文整理汇总了Python中win32con.BN_CLICKED属性的典型用法代码示例。如果您正苦于以下问题:Python win32con.BN_CLICKED属性的具体用法?Python win32con.BN_CLICKED怎么用?Python win32con.BN_CLICKED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类win32con
的用法示例。
在下文中一共展示了win32con.BN_CLICKED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnButtonMove
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例2: clickButton
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例3: clickButton
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例4: OnInitDialog
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例5: _DoButDefaultFont
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例6: OnButDefaultFixedFont
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
def OnButDefaultFixedFont(self, id, code):
if code==win32con.BN_CLICKED:
self._DoButDefaultFont(win32con.CF_FIXEDPITCHONLY, "baseFormatFixed")
return 1
示例7: OnButDefaultPropFont
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
def OnButDefaultPropFont(self, id, code):
if code==win32con.BN_CLICKED:
self._DoButDefaultFont(win32con.CF_SCALABLEONLY, "baseFormatProp")
return 1
示例8: OnButFixedOrDefault
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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
示例9: OnButUseDefaultFont
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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
示例10: OnButThisBackground
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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
示例11: OnButUseDefaultBackground
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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
示例12: OnStyleUIChanged
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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
示例13: HandleCharFormatChange
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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!
示例14: OnButtonNew
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)
示例15: OnButtonDelete
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import BN_CLICKED [as 别名]
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)