Python win32con.WS_CHILD Examples

The following are 30 code examples of win32con.WS_CHILD(). 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: dyndlg.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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 
Example #2
Source File: find.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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],
			["Edit", "", 102, (60, 7, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL],
			["Static", "Re&place with:", 103, (5, 25, 50, 10), visible],
			["Edit", "", 104, (60, 24, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_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 
Example #3
Source File: find.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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],
			["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_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 
Example #4
Source File: list.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def _maketemplate(self, title):
		style = win32con.WS_DLGFRAME | win32con.WS_SYSMENU | win32con.WS_VISIBLE
		ls = (
			win32con.WS_CHILD           |
			win32con.WS_VISIBLE         |
			commctrl.LVS_ALIGNLEFT      |
			commctrl.LVS_REPORT
		    )
		bs = (
			win32con.WS_CHILD           |
			win32con.WS_VISIBLE
		     )
		return [ [title, (0, 0, 200, 200), style, None, (8, "MS Sans Serif")],
			["SysListView32", None, win32ui.IDC_LIST1, (0, 0, 200, 200), ls], 
			[128,	"OK", win32con.IDOK, (10, 0, 50, 14), bs | win32con.BS_DEFPUSHBUTTON],
			[128,	"Cancel",win32con.IDCANCEL,(0, 0, 50, 14), bs],
		    ] 
Example #5
Source File: interact.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def Create(self):
		self.bCreating = 1
		doc = InteractiveDocument(None, self.DoCreateDoc())
		view = DockedInteractiveView(doc)
		defRect = pywin.framework.app.LoadWindowSize("Interactive Window", "docked")
		if defRect[2]-defRect[0]==0:
			defRect = 0, 0, 500, 200
		style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER
		id = 1050 # win32ui.AFX_IDW_PANE_FIRST
		view.CreateWindow(self.dockbar, id, style, defRect)
		view.OnInitialUpdate()
		self.bFirstCreated = 1

		self.currentView = doc.GetFirstView()
		self.bCreating = 0
		if self.title: doc.SetTitle(self.title)

# The factory we pass to the dockable window support. 
Example #6
Source File: ControlService.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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 = [["Service Startup", (6, 18, 188, 107), style, exstyle, (8, 'MS Shell Dlg')], ]
		t.append([130, "Device:", self.IDC_LABEL, (6, 7, 40, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])
		t.append([130, "", self.IDC_DEVICE, (48, 7, 134, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])
		t.append([128, "Startup Type", -1, (6, 21, 130, 80), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.BS_GROUPBOX])
		t.append([128, "&Boot", self.IDC_BOOT, (12, 33, 39, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])
		t.append([128, "&System", self.IDC_SYSTEM, (12, 46, 39, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])
		t.append([128, "&Automatic", self.IDC_AUTOMATIC, (12, 59, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])
		t.append([128, "&Manual", self.IDC_MANUAL, (12, 72, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])
		t.append([128, "&Disabled", self.IDC_DISABLED, (12, 85, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])
		t.append([128, "OK", win32con.IDOK, (142, 25, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.WS_GROUP | win32con.BS_DEFPUSHBUTTON])
		t.append([128, "Cancel", win32con.IDCANCEL, (142, 43, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])
		t.append([128, "&Help", win32con.IDHELP, (142, 61, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])
		return t 
Example #7
Source File: ControlService.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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 
Example #8
Source File: ietoolbar.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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) 
Example #9
Source File: login.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def MakeLoginDlgTemplate(title):
	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

	# Window frame and title
	dlg = [ [title, (0, 0, 184, 40), style, None, (8, "MS Sans Serif")], ]

	# ID label and text box
	dlg.append([130, "User ID:", -1, (7, 9, 69, 9), cs | win32con.SS_LEFT])
	s = cs | win32con.WS_TABSTOP | win32con.WS_BORDER 
	dlg.append(['EDIT', None, win32ui.IDC_EDIT1, (50, 7, 60, 12), s])

	# Password label and text box
	dlg.append([130, "Password:", -1, (7, 22, 69, 9), cs | win32con.SS_LEFT])
	s = cs | win32con.WS_TABSTOP | win32con.WS_BORDER 
	dlg.append(['EDIT', None, win32ui.IDC_EDIT2, (50, 20, 60, 12), s | win32con.ES_PASSWORD])

	# OK/Cancel Buttons
	s = cs | 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, 20, 50, 14), s])
	return dlg 
Example #10
Source File: login.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def MakePasswordDlgTemplate(title):
	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
	# Window frame and title
	dlg = [ [title, (0, 0, 177, 45), style, None, (8, "MS Sans Serif")], ]
	
	# Password label and text box
	dlg.append([130, "Password:", -1, (7, 7, 69, 9), cs | win32con.SS_LEFT])
	s = cs | win32con.WS_TABSTOP | win32con.WS_BORDER 
	dlg.append(['EDIT', None, win32ui.IDC_EDIT1, (50, 7, 60, 12), s | win32con.ES_PASSWORD])
	
	# OK/Cancel Buttons
	s = cs | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON
	dlg.append([128, "OK", win32con.IDOK, (124, 5, 50, 14), s | win32con.BS_DEFPUSHBUTTON])
	dlg.append([128, "Cancel", win32con.IDCANCEL, (124, 22, 50, 14), s])
	return dlg 
Example #11
Source File: dyndlg.py    From eavatar-me with Apache License 2.0 6 votes vote down vote up
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(
        ["{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 
Example #12
Source File: simpledialog.py    From eavatar-me with Apache License 2.0 6 votes vote down vote up
def MakePasswordDlgTemplate(title):
    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
    # Window frame and title
    dlg = [[title, (0, 0, 177, 45), style, None, (8, "MS Sans Serif")], ]

    # Password label and text box
    dlg.append([130, "Password:", -1, (7, 7, 69, 9), cs | win32con.SS_LEFT])
    s = cs | win32con.WS_TABSTOP | win32con.WS_BORDER
    dlg.append(['EDIT', None, win32ui.IDC_EDIT1, (50, 7, 60, 12),
                s | win32con.ES_PASSWORD])

    # OK/Cancel Buttons
    s = cs | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON
    dlg.append([128, "OK", win32con.IDOK, (124, 5, 50, 14),
                s | win32con.BS_DEFPUSHBUTTON])
    dlg.append([128, "Cancel", win32con.IDCANCEL, (124, 22, 50, 14), s])
    return dlg 
Example #13
Source File: ocxtest.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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
# 
Example #14
Source File: ocxserialtest.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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
# 
Example #15
Source File: winapi.py    From gui-o-matic with GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__( self, parent, rect, action ):
            super( Window.Button, self ).__init__()

            style = win32con.WS_TABSTOP | win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.BS_DEFPUSHBUTTON
            
            self.handle = win32gui.CreateWindowEx( 0,
                                                   "BUTTON",
                                                   action.label,
                                                   style,
                                                   rect[ 0 ],
                                                   rect[ 1 ],
                                                   rect[ 2 ],
                                                   rect[ 3 ],
                                                   parent.window_handle,
                                                   self.registry_id,
                                                   win32gui.GetModuleHandle(None),
                                                   None )
            self.set_action( action ) 
Example #16
Source File: debugger.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def CreateWindow(self, parent):
		list = self
		style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | commctrl.LVS_EDITLABELS | commctrl.LVS_REPORT
		self._obj_.CreateWindow(style, self.GetDefRect(), parent, win32ui.IDC_LIST1)
		self.HookMessage(self.OnKeyDown, win32con.WM_KEYDOWN)
		self.HookMessage(self.OnKeyDown, win32con.WM_SYSKEYDOWN)
		list = self
		title, width = self.columns[0]
		itemDetails = (commctrl.LVCFMT_LEFT, width, title, 0)
		list.InsertColumn(0, itemDetails)
		col = 1
		for title, width in self.columns[1:]:
			col = col + 1
			itemDetails = (commctrl.LVCFMT_LEFT, width, title, 0)
			list.InsertColumn(col, itemDetails)
		parent.HookNotify(self.OnListEndLabelEdit, LVN_ENDLABELEDIT)
		parent.HookNotify(self.OnItemRightClick, commctrl.NM_RCLICK)
		parent.HookNotify(self.OnItemDoubleClick, commctrl.NM_DBLCLK) 
Example #17
Source File: winapi.py    From gui-o-matic with GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__( self, parent ):
            super( Window.ProgressBar, self ).__init__()
            rect = win32gui.GetClientRect( parent.window_handle )
            yscroll = win32api.GetSystemMetrics(win32con.SM_CYVSCROLL)
            self.handle = win32gui.CreateWindowEx( 0,
                                                   commctrl.PROGRESS_CLASS,
                                                   None,
                                                   win32con.WS_VISIBLE | win32con.WS_CHILD,
                                                   rect[ 0 ] + yscroll,
                                                   (rect[ 3 ]) - 2 * yscroll,
                                                   (rect[ 2 ] - rect[ 0 ]) - 2*yscroll,
                                                   yscroll,
                                                   parent.window_handle,
                                                   self.registry_id,
                                                   win32gui.GetModuleHandle(None),
                                                   None ) 
Example #18
Source File: DockingBar.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def CreateWindow(self, parent, childCreator, title, id, style=win32con.WS_CHILD | win32con.WS_VISIBLE | afxres.CBRS_LEFT, childCreatorArgs=()):
		assert not ((style & afxres.CBRS_SIZE_FIXED) and (style & afxres.CBRS_SIZE_DYNAMIC)), "Invalid style"
		self.rectClose = self.rectBorder = self.rectGripper = self.rectTracker = 0,0,0,0

		# save the style
		self._obj_.dwStyle = style & afxres.CBRS_ALL

		cursor = win32api.LoadCursor(0, win32con.IDC_ARROW)
		wndClass = win32ui.RegisterWndClass(win32con.CS_DBLCLKS, cursor, self.brushBkgd.GetSafeHandle(), 0)

		self._obj_.CreateWindow(wndClass, title, style, (0,0,0,0), parent, id)

		# Create the child dialog
		self.dialog = childCreator(*(self,) + childCreatorArgs)

		# use the dialog dimensions as default base dimensions
		assert self.dialog.IsWindow(), "The childCreator function %s did not create a window!" % childCreator
		rect = self.dialog.GetWindowRect()
		self.sizeHorz = self.sizeVert = self.sizeFloat = rect[2]-rect[0], rect[3]-rect[1]

		self.sizeHorz = self.sizeHorz[0], self.sizeHorz[1] + self.cxEdge + self.cxBorder
		self.sizeVert = self.sizeVert[0] + self.cxEdge + self.cxBorder, self.sizeVert[1]
		self.HookMessages() 
Example #19
Source File: shell_view.py    From Email_My_PC with MIT License 6 votes vote down vote up
def _CreateMainWindow(self, prev, settings, browser, rect):
        # Creates a parent window that hosts the view window.  This window
        # gets the control notifications etc sent from the child.
        style = win32con.WS_CHILD | win32con.WS_VISIBLE #
        wclass_name = "ShellViewDemo_DefView"
        # Register the Window class.
        wc = win32gui.WNDCLASS()
        wc.hInstance = win32gui.dllhandle
        wc.lpszClassName = wclass_name
        wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW
        try:
            win32gui.RegisterClass(wc)
        except win32gui.error, details:
            # Should only happen when this module is reloaded
            if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS:
                raise 
Example #20
Source File: shell_view.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def _CreateMainWindow(self, prev, settings, browser, rect):
        # Creates a parent window that hosts the view window.  This window
        # gets the control notifications etc sent from the child.
        style = win32con.WS_CHILD | win32con.WS_VISIBLE #
        wclass_name = "ShellViewDemo_DefView"
        # Register the Window class.
        wc = win32gui.WNDCLASS()
        wc.hInstance = win32gui.dllhandle
        wc.lpszClassName = wclass_name
        wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW
        try:
            win32gui.RegisterClass(wc)
        except win32gui.error, details:
            # Should only happen when this module is reloaded
            if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS:
                raise 
Example #21
Source File: sgrepmdi.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def __init__(self, dp, fp, gp, cs, r, v):
		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
		tmp = [ ["Grep", (0, 0, 210, 90), style, None, (8, "MS Sans Serif")], ]
		tmp.append([STATIC, "Grep For:",            -1, (7,   7,  50,  9), CS ])
		tmp.append([EDIT,   gp,                    101, (52,  7, 144,  11), CS | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER])
		tmp.append([STATIC, "Directories:",         -1, (7,  20,  50,  9), CS ])
		tmp.append([EDIT,   dp,                    102, (52, 20, 128,  11), CS | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER])
		tmp.append([BUTTON, '...',                 110, (182,20,  16,  11), CS | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP]) 
		tmp.append([STATIC, "File types:",          -1, (7,  33,  50,  9), CS ])
		tmp.append([EDIT,   fp,                    103, (52, 33, 128,  11), CS | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER ])
		tmp.append([BUTTON, '...',                 111, (182,33,  16,  11), CS | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP]) 
		tmp.append([BUTTON,'Case sensitive',       104, (7,  45,  72,  9), CS | win32con.BS_AUTOCHECKBOX | win32con.BS_LEFTTEXT| win32con.WS_TABSTOP])
		tmp.append([BUTTON,'Subdirectories',       105, (7,  56,  72,  9), CS | win32con.BS_AUTOCHECKBOX | win32con.BS_LEFTTEXT| win32con.WS_TABSTOP])
		tmp.append([BUTTON,'Verbose',              106, (7,  67,  72,  9), CS | win32con.BS_AUTOCHECKBOX | win32con.BS_LEFTTEXT| win32con.WS_TABSTOP])
		tmp.append([BUTTON,'OK',         win32con.IDOK, (166,53,  32, 12), CS | win32con.BS_DEFPUSHBUTTON| win32con.WS_TABSTOP])
		tmp.append([BUTTON,'Cancel', win32con.IDCANCEL, (166,67,  32, 12), CS | win32con.BS_PUSHBUTTON| win32con.WS_TABSTOP])
		dialog.Dialog.__init__(self, tmp)
		self.AddDDX(101,'greppattern')
		self.AddDDX(102,'dirpattern')
		self.AddDDX(103,'filpattern')
		self.AddDDX(104,'casesensitive')
		self.AddDDX(105,'recursive')
		self.AddDDX(106,'verbose')
		self._obj_.data['greppattern'] = gp
		self._obj_.data['dirpattern']  = dp
		self._obj_.data['filpattern']  = fp
		self._obj_.data['casesensitive']  = cs
		self._obj_.data['recursive'] = r
		self._obj_.data['verbose']  = v
		self.HookCommand(self.OnMoreDirectories, 110)
		self.HookCommand(self.OnMoreFiles, 111) 
Example #22
Source File: mdi_pychecker.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def __init__(self, items):
        self.items = items
        self.newitems = []
        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
        tmp = [ ["Pychecker Parameters", (0, 0, 205, 100), style, None, (8, "MS Sans Serif")], ]
        tmp.append([LISTBOX, '',                   107, (7,   7,  150,  72), CS | win32con.LBS_MULTIPLESEL| win32con.LBS_STANDARD | win32con.LBS_HASSTRINGS | win32con.WS_TABSTOP | win32con.LBS_NOTIFY])
        tmp.append([BUTTON,'OK',         win32con.IDOK, (167, 7,  32, 12), CS | win32con.BS_DEFPUSHBUTTON| win32con.WS_TABSTOP])
        tmp.append([BUTTON,'Cancel', win32con.IDCANCEL, (167,23,  32, 12), CS | win32con.BS_PUSHBUTTON| win32con.WS_TABSTOP])
        tmp.append([STATIC,'New:',                  -1, (2,  83,  15,  12), CS])
        tmp.append([EDIT,  '',                     108, (18, 83,  139,  12), CS | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER])
        tmp.append([BUTTON,'Add',                  109, (167,83,  32, 12), CS | win32con.BS_PUSHBUTTON| win32con.WS_TABSTOP]) 
        dialog.Dialog.__init__(self, tmp)
        self.HookCommand(self.OnAddItem, 109)
        self.HookCommand(self.OnListDoubleClick, 107) 
Example #23
Source File: sgrepmdi.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def __init__(self, items):
		self.items = items
		self.newitems = []
		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
		tmp = [ ["Grep Parameters", (0, 0, 205, 100), style, None, (8, "MS Sans Serif")], ]
		tmp.append([LISTBOX, '',                   107, (7,   7,  150,  72), CS | win32con.LBS_MULTIPLESEL| win32con.LBS_STANDARD | win32con.LBS_HASSTRINGS | win32con.WS_TABSTOP | win32con.LBS_NOTIFY])
		tmp.append([BUTTON,'OK',         win32con.IDOK, (167, 7,  32, 12), CS | win32con.BS_DEFPUSHBUTTON| win32con.WS_TABSTOP])
		tmp.append([BUTTON,'Cancel', win32con.IDCANCEL, (167,23,  32, 12), CS | win32con.BS_PUSHBUTTON| win32con.WS_TABSTOP])
		tmp.append([STATIC,'New:',                  -1, (2,  83,  15,  12), CS])
		tmp.append([EDIT,  '',                     108, (18, 83,  139,  12), CS | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER])
		tmp.append([BUTTON,'Add',                  109, (167,83,  32, 12), CS | win32con.BS_PUSHBUTTON| win32con.WS_TABSTOP]) 
		dialog.Dialog.__init__(self, tmp)
		self.HookCommand(self.OnAddItem, 109)
		self.HookCommand(self.OnListDoubleClick, 107) 
Example #24
Source File: shell_view.py    From Email_My_PC with MIT License 5 votes vote down vote up
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 
Example #25
Source File: win32gui_dialog.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def _GetDialogTemplate(self, dlgClassName):
        style = win32con.WS_THICKFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT | win32con.WS_MINIMIZEBOX
        cs = win32con.WS_CHILD | win32con.WS_VISIBLE
        title = "Dynamic Dialog Demo"

        # Window frame and title
        dlg = [ [title, (0, 0, 210, 250), style, None, (8, "MS Sans Serif"), None, dlgClassName], ]

        # ID label and text box
        dlg.append([130, "Enter something", -1, (5, 5, 200, 9), cs | win32con.SS_LEFT])
        s = cs | win32con.WS_TABSTOP | win32con.WS_BORDER
        dlg.append(['EDIT', None, IDC_SEARCHTEXT, (5, 15, 200, 12), s])

        # Search/Display Buttons
        # (x positions don't matter here)
        s = cs | win32con.WS_TABSTOP
        dlg.append([128, "Fill List", IDC_BUTTON_SEARCH, (5, 35, 50, 14), s | win32con.BS_DEFPUSHBUTTON])
        s = win32con.BS_PUSHBUTTON | s
        dlg.append([128, "Display", IDC_BUTTON_DISPLAY, (100, 35, 50, 14), s])

        # List control.
        # Can't make this work :(
##        s = cs | win32con.WS_TABSTOP
##        dlg.append(['SysListView32', "Title", IDC_LISTBOX, (5, 505, 200, 200), s])

        return dlg 
Example #26
Source File: win32gui_dialog.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
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) 
Example #27
Source File: control_button.py    From dragonfly with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, text, size, default=False, **kwargs):
        flavor = 128
        style =  ( win32con.BS_PUSHBUTTON
                 | win32con.BS_TEXT
                 | win32con.WS_CHILD
                 | win32con.WS_TABSTOP
                 | win32con.WS_OVERLAPPED
                 | win32con.WS_VISIBLE)
        if default:  style |= win32con.BS_DEFPUSHBUTTON
        else:        style |= win32con.BS_PUSHBUTTON
        ControlBase.__init__(self, parent, flavor, text, size, style,
                             **kwargs) 
Example #28
Source File: control_output.py    From dragonfly with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, size, **kwargs):
        flavor = "EDIT"
        text = ""
        style = ( win32con.WS_CHILD
                | win32con.WS_VISIBLE
                | win32con.ES_LEFT
                | win32con.ES_MULTILINE
                | win32con.ES_AUTOVSCROLL
                | win32con.WS_TABSTOP
                | win32con.WS_BORDER
                | win32con.ES_READONLY
                | win32con.WS_VSCROLL)
        ControlBase.__init__(self, parent, flavor, text, size, style, **kwargs) 
Example #29
Source File: console.py    From eavatar-me with Apache License 2.0 5 votes vote down vote up
def _GetDialogTemplate(self, dlgClassName):
        style = (win32con.WS_POPUP | win32con.DS_MODALFRAME |
                 win32con.WS_VISIBLE | win32con.WS_CAPTION |
                 win32con.WS_SYSMENU | win32con.DS_SETFONT |
                 win32con.WS_MINIMIZEBOX)
        cs = win32con.WS_CHILD | win32con.WS_VISIBLE

        # Window frame and title
        # font_name = 'COURIER'
        font_name = "MS Sans Serif"
        dlg = [
            [self.title, (0, 0, 230, 170), style, None, (11, font_name), None,
             dlgClassName], ]

        s = (cs | win32con.WS_TABSTOP | win32con.WS_BORDER |
             win32con.ES_MULTILINE)
        s |= (win32con.WS_VSCROLL | win32con.ES_AUTOVSCROLL |
              win32con.ES_READONLY | win32con.ES_WANTRETURN)
        dlg.append(['EDIT', None, IDC_MESSAGE, (5, 5, 220, 60), s])

        dlg.append(
            [130, 'Instructions:', -1, (5, 70, 220, 9), cs | win32con.SS_LEFT])
        s = (cs | win32con.WS_TABSTOP | win32con.WS_BORDER |
             win32con.ES_MULTILINE)
        s |= (win32con.WS_VSCROLL | win32con.ES_AUTOVSCROLL |
              win32con.ES_WANTRETURN)
        dlg.append(['EDIT', None, IDC_SCRIPT, (5, 80, 220, 70), s])

        ss = cs | win32con.SS_ENDELLIPSIS
        dlg.append(['STATIC', None, IDC_LABEL_STATUS, (5, 155, 100, 14), ss])

        # OK/Cancel Buttons
        # (x positions don't matter here)
        s = cs | win32con.WS_TABSTOP
        # dlg.append([128, "Clear", IDC_BUTTON_CLEAR, (5, 155, 50, 14), s])
        # dlg.append([128, "Close", IDC_BUTTON_CLOSE, (125, 155, 50, 14), s])
        s = win32con.BS_PUSHBUTTON | s
        dlg.append([128, "Submit", IDC_BUTTON_SUBMIT, (100, 155, 50, 14), s])

        return dlg 
Example #30
Source File: notice_dlg.py    From eavatar-me with Apache License 2.0 5 votes vote down vote up
def _GetDialogTemplate(self, dlgClassName):
        style = (win32con.WS_POPUP | win32con.DS_MODALFRAME |
                 win32con.WS_VISIBLE | win32con.WS_CAPTION |
                 win32con.WS_SYSMENU | win32con.DS_SETFONT |
                 win32con.WS_MINIMIZEBOX)
        cs = win32con.WS_CHILD | win32con.WS_VISIBLE

        # Window frame and title
        # font_name = 'COURIER'
        font_name = "MS Sans Serif"
        dlg = [[self.title, (0, 0, 230, 180), style, None,
               (11, font_name), None, dlgClassName], ]

        # ID label and text box

        dlg.append([130, 'Instructions:', -1, (5, 30, 220, 9),
                    cs | win32con.SS_LEFT])
        s = (cs | win32con.WS_TABSTOP | win32con.WS_BORDER |
             win32con.ES_MULTILINE)
        s |= (win32con.WS_VSCROLL | win32con.ES_AUTOVSCROLL |
              win32con.ES_WANTRETURN)
        dlg.append(['EDIT', None, IDC_SCRIPT, (5, 40, 220, 110), s])

        # OK/Cancel Buttons
        # (x positions don't matter here)
        s = cs | win32con.WS_TABSTOP
        # dlg.append([128, "Clear", IDC_BUTTON_CLEAR, (5, 155, 50, 14), s])
        dlg.append([128, "Close", IDC_BUTTON_CLOSE, (125, 155, 50, 14), s])
        s = win32con.BS_PUSHBUTTON | s
        dlg.append([128, "Submit", IDC_BUTTON_SUBMIT, (100, 155, 50, 14), s])

        return dlg