我们从Python开源项目中,提取了以下17个代码示例,用于说明如何使用win32con.WS_VSCROLL。
def GetResource(self): style = win32con.WS_POPUP | win32con.DS_SETFONT | win32con.WS_SYSMENU | win32con.WS_CAPTION | win32con.WS_VISIBLE | win32con.DS_MODALFRAME exstyle = None t = [["Services", (16, 16, 333, 157), style, exstyle, (8, 'MS Shell Dlg')], ] t.append([130, "Ser&vice", -1, (6, 6, 70, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT]) t.append([130, "Status", -1, (164, 6, 42, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT]) t.append([130, "Startup", -1, (206, 6, 50, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT]) t.append([131, "", self.IDC_LIST, (6, 16, 255, 106), win32con.LBS_USETABSTOPS | win32con.LBS_SORT | win32con.LBS_NOINTEGRALHEIGHT | win32con.WS_BORDER | win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_TABSTOP | win32con.LBS_NOTIFY | win32con.WS_VSCROLL]) t.append([128, "Close", win32con.IDOK, (267, 6, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.WS_TABSTOP | win32con.BS_DEFPUSHBUTTON]) t.append([128, "&Start", self.IDC_START, (267, 27, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "S&top", self.IDC_STOP, (267, 44, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "&Pause", self.IDC_PAUSE, (267, 61, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "&Continue", self.IDC_CONTINUE, (267, 78, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "Sta&rtup...", self.IDC_STARTUP, (267, 99, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "H&W Profiles...", self.IDC_PROFILES, (267, 116, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([128, "&Help", win32con.IDHELP, (267, 137, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON]) t.append([130, "St&artup Parameters:", -1, (6, 128, 70, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT]) t.append([129, "", self.IDC_PARAMS, (6, 139, 247, 12), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.WS_BORDER | win32con.ES_AUTOHSCROLL]) return t
def MakeDlgTemplate(): style = win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT cs = win32con.WS_CHILD | win32con.WS_VISIBLE dlg = [ ["OCX Demos", (0, 0, 350, 350), style, None, (8, "MS Sans Serif")], ] s = win32con.WS_TABSTOP | cs # dlg.append([131, None, 130, (5, 40, 110, 48), # s | win32con.LBS_NOTIFY | win32con.LBS_SORT | win32con.LBS_NOINTEGRALHEIGHT | win32con.WS_VSCROLL | win32con.WS_BORDER]) # dlg.append(["{8E27C92B-1264-101C-8A2F-040224009C02}", None, 131, (5, 40, 110, 48),win32con.WS_TABSTOP]) dlg.append([128, "About", win32con.IDOK, (124, 5, 50, 14), s | win32con.BS_DEFPUSHBUTTON]) s = win32con.BS_PUSHBUTTON | s dlg.append([128, "Close", win32con.IDCANCEL, (124, 22, 50, 14), s]) return dlg #################################### # # Calendar test code #
def MakeDlgTemplate(): style = win32con.DS_MODALFRAME | win32con.WS_POPUP \ | win32con.WS_VISIBLE | win32con.WS_CAPTION \ | win32con.WS_SYSMENU | win32con.DS_SETFONT cs = win32con.WS_CHILD | win32con.WS_VISIBLE dlg = [ ["Very Basic Terminal", (0, 0, 350, 180), style, None, (8, "MS Sans Serif")], ] s = win32con.WS_TABSTOP | cs dlg.append(["RICHEDIT", None, 132, (5, 5, 340, 170),s | win32con.ES_WANTRETURN | win32con.ES_MULTILINE | win32con.ES_AUTOVSCROLL | win32con.WS_VSCROLL]) return dlg #################################### # # Serial Control #
def _GetDialogTemplate(self): style = win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ["Find", (0, 2, 240, 75), style, None, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["ComboBox", "", 102, (50, 7, 120, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Button", "Match &whole word only", 105, (5, 23, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Match &case", 107, (5, 33, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Keep &dialog open", 115, (5, 43, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Across &open files", 116, (5, 52, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "&Remember as default search", 117, (5, 61, 150, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "&Find Next", 109, (185, 5, 50, 14), visible | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP], ["Button", "Cancel", win32con.IDCANCEL, (185, 23, 50, 14), visible | win32con.WS_TABSTOP], ] return dt
def _GetDialogTemplate(self): style = win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ["Replace", (0, 2, 240, 95), style, 0, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["ComboBox", "", 102, (60, 7, 110, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Static", "Re&place with:", 103, (5, 25, 50, 10), visible], ["ComboBox", "", 104, (60, 24, 110, 120), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.WS_VSCROLL |win32con.CBS_DROPDOWN |win32con.CBS_AUTOHSCROLL], ["Button", "Match &whole word only", 105, (5, 42, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Match &case", 107, (5, 52, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Keep &dialog open", 115, (5, 62, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "Across &open files", 116, (5, 72, 100, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "&Remember as default search", 117, (5, 81, 150, 10), visible | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ["Button", "&Find Next", 109, (185, 5, 50, 14), visible | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP], ["Button", "&Replace", 110, (185, 23, 50, 14), visible | win32con.WS_TABSTOP], ["Button", "Replace &All", 111, (185, 41, 50, 14), visible | win32con.WS_TABSTOP], ["Button", "Cancel", win32con.IDCANCEL, (185, 59, 50, 14), visible | win32con.WS_TABSTOP], ] return dt
def MakeDlgTemplate(): style = win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT cs = win32con.WS_CHILD | win32con.WS_VISIBLE dlg = [ ["Select Warehouse", (0, 0, 177, 93), style, None, (8, "MS Sans Serif")], ] dlg.append([130, "Current Warehouse:", -1, (7, 7, 69, 9), cs | win32con.SS_LEFT]) dlg.append([130, "ASTORIA", 128, (16, 17, 99, 7), cs | win32con.SS_LEFT]) dlg.append([130, "New &Warehouse:", -1, (7, 29, 69, 9), cs | win32con.SS_LEFT]) s = win32con.WS_TABSTOP | cs # dlg.append([131, None, 130, (5, 40, 110, 48), # s | win32con.LBS_NOTIFY | win32con.LBS_SORT | win32con.LBS_NOINTEGRALHEIGHT | win32con.WS_VSCROLL | win32con.WS_BORDER]) dlg.append(["{8E27C92B-1264-101C-8A2F-040224009C02}", None, 131, (5, 40, 110, 48),win32con.WS_TABSTOP]) dlg.append([128, "OK", win32con.IDOK, (124, 5, 50, 14), s | win32con.BS_DEFPUSHBUTTON]) s = win32con.BS_PUSHBUTTON | s dlg.append([128, "Cancel", win32con.IDCANCEL, (124, 22, 50, 14), s]) dlg.append([128, "&Help", 100, (124, 74, 50, 14), s]) return dlg
def CreateViewWindow(self, prev, settings, browser, rect): print "ScintillaShellView.CreateViewWindow", prev, settings, browser, rect # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) try: win32api.GetModuleHandle("Scintilla.dll") except win32api.error: for p in sys.path: fname = os.path.join(p, "Scintilla.dll") if not os.path.isfile(fname): fname = os.path.join(p, "Build", "Scintilla.dll") if os.path.isfile(fname): win32api.LoadLibrary(fname) break else: raise RuntimeError("Can't find scintilla!") style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ win32con.WS_HSCROLL | win32con.WS_CLIPCHILDREN | \ win32con.WS_VISIBLE self.hwnd = win32gui.CreateWindow("Scintilla", "Scintilla", style, rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1], self.hwnd_parent, 1000, 0, None) message_map = { win32con.WM_SIZE: self.OnSize, } # win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) file_data = file(self.filename, "U").read() self._SetupLexer() self._SendSci(scintillacon.SCI_ADDTEXT, len(file_data), file_data) if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) print "Scintilla's hwnd is", self.hwnd
def _SetupList(self): child_style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | win32con.WS_HSCROLL | win32con.WS_VSCROLL child_style |= commctrl.LVS_SINGLESEL | commctrl.LVS_SHOWSELALWAYS | commctrl.LVS_REPORT self.hwndList = win32gui.CreateWindow("SysListView32", None, child_style, 0, 0, 100, 100, self.hwnd, IDC_LISTBOX, self.hinst, None) child_ex_style = win32gui.SendMessage(self.hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0) child_ex_style |= commctrl.LVS_EX_FULLROWSELECT win32gui.SendMessage(self.hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style) # Add an image list - use the builtin shell folder icon - this # demonstrates the problem with alpha-blending of icons on XP if # winxpgui is not used in place of win32gui. il = win32gui.ImageList_Create( win32api.GetSystemMetrics(win32con.SM_CXSMICON), win32api.GetSystemMetrics(win32con.SM_CYSMICON), commctrl.ILC_COLOR32 | commctrl.ILC_MASK, 1, # initial size 0) # cGrow shell_dll = os.path.join(win32api.GetSystemDirectory(), "shell32.dll") large, small = win32gui.ExtractIconEx(shell_dll, 4, 1) win32gui.ImageList_ReplaceIcon(il, -1, small[0]) win32gui.DestroyIcon(small[0]) win32gui.DestroyIcon(large[0]) win32gui.SendMessage(self.hwndList, commctrl.LVM_SETIMAGELIST, commctrl.LVSIL_SMALL, il) # Setup the list control columns. lvc = LVCOLUMN(mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM) lvc.fmt = commctrl.LVCFMT_LEFT lvc.iSubItem = 1 lvc.text = "Title" lvc.cx = 200 win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam()) lvc.iSubItem = 0 lvc.text = "Order" lvc.cx = 50 win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam()) win32gui.UpdateWindow(self.hwnd)
def __init__(self, doc): docview.CtrlView.__init__(self, doc, "Scintilla", win32con.WS_CHILD | win32con.WS_VSCROLL | win32con.WS_HSCROLL | win32con.WS_CLIPCHILDREN | win32con.WS_VISIBLE) self._tabWidth = 8 # Mirror of what we send to Scintilla - never change this directly self.bAutoCompleteAttributes = 1 self.bShowCallTips = 1 self.bMatchBraces = 0 # Editor option will default this to true later! self.bindings = bindings.BindingsManager(self) self.idle = IDLEenvironment.IDLEEditorWindow(self) self.idle.IDLEExtension("AutoExpand") # SendScintilla is called so frequently it is worth optimizing. self.SendScintilla = self._obj_.SendMessage
def CreateViewWindow(self, prev, settings, browser, rect): print("ScintillaShellView.CreateViewWindow", prev, settings, browser, rect) # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) try: win32api.GetModuleHandle("Scintilla.dll") except win32api.error: for p in sys.path: fname = os.path.join(p, "Scintilla.dll") if not os.path.isfile(fname): fname = os.path.join(p, "Build", "Scintilla.dll") if os.path.isfile(fname): win32api.LoadLibrary(fname) break else: raise RuntimeError("Can't find scintilla!") style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ win32con.WS_HSCROLL | win32con.WS_CLIPCHILDREN | \ win32con.WS_VISIBLE self.hwnd = win32gui.CreateWindow("Scintilla", "Scintilla", style, rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1], self.hwnd_parent, 1000, 0, None) message_map = { win32con.WM_SIZE: self.OnSize, } # win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) file_data = file(self.filename, "U").read() self._SetupLexer() self._SendSci(scintillacon.SCI_ADDTEXT, len(file_data), file_data) if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) print("Scintilla's hwnd is", self.hwnd)