我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用win32con.WS_CLIPCHILDREN。
def __init__(self,hwndparent): styles = win32con.WS_CHILD \ | win32con.WS_VISIBLE \ | win32con.WS_CLIPSIBLINGS \ | win32con.WS_CLIPCHILDREN \ | commctrl.TBSTYLE_LIST \ | commctrl.TBSTYLE_FLAT \ | commctrl.TBSTYLE_TRANSPARENT \ | commctrl.CCS_TOP \ | commctrl.CCS_NODIVIDER \ | commctrl.CCS_NORESIZE \ | commctrl.CCS_NOPARENTALIGN self.hwnd = win32gui.CreateWindow('ToolbarWindow32', None, styles, 0, 0, 100, 100, hwndparent, 0, win32gui.dllhandle, None) win32gui.SendMessage(self.hwnd, commctrl.TB_BUTTONSTRUCTSIZE, 20, 0)
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 PreCreateWindow(self, cc): self.HookMessage (self.OnSize, win32con.WM_SIZE) # An OpenGL window must be created with the following flags and must not # include CS_PARENTDC for the class style. Refer to SetPixelFormat # documentation in the "Comments" section for further information. style = cc[5] style = style | win32con.WS_CLIPSIBLINGS | win32con.WS_CLIPCHILDREN cc = cc[0], cc[1], cc[2], cc[3], cc[4], style, cc[6], cc[7], cc[8] cc = self._obj_.PreCreateWindow(cc) return cc
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)