Beispiel #1
0
	def OnCreate(self, event):
		coolBar = coolbar.CoolBar(parent = self)

		commandBar = coolbar.CommandBar(parent = coolBar)
		commandBar.AttachMenu(self.menu)

		addressBar = comctl.ComboBox(parent = coolBar)

		buttons = coolbar.ToolBar(parent = coolBar)
		buttons.SetImageList(iml)
		buttons.SetButtonSize(ims, ims)

		button = comctl.TBBUTTON()
		button.idCommand = form.ID_NEW
		#~ button.idCommand = form.ID_CLOSE
		button.fsState = comctl.TBSTATE_ENABLED
		button.fsStyle = comctl.TBSTYLE_BUTTON
		for i in range(iml.GetImageCount()-6):
			button.iBitmap = 1 + i
			buttons.InsertButton(0, button)

		progressBar = comctl.ProgressBar(parent = coolBar, orStyle = comctl.PBS_SMOOTH)
		progressBar.SetBarColor(gdi.RGB(100, 200, 255))
		progressBar.SetBkColor(gdi.RGB(55, 55, 55))
		progressBar.MoveWindow(0, 0, 200, 20, False)
		progressBar.SetRange(0, 500)
		progressBar.SetPos(450)

		aTrackBar = MyTrackBar(parent = coolBar, progress_bar = progressBar, rcPos = RECT(0, 0, 200, 40))
		aTrackBar.SetRange(0, 500)
		aTrackBar.SetPos(450)

		coolBar.SetRedraw(False)
		coolBar.AddSimpleRebarBandCtrl(commandBar)
		coolBar.AddSimpleRebarBandCtrl(buttons, bNewRow = True)
		coolBar.AddSimpleRebarBandCtrl(aTrackBar, cxWidth = 100)
		coolBar.AddSimpleRebarBandCtrl(addressBar, bNewRow = True)
		coolBar.AddSimpleRebarBandCtrl(progressBar, bNewRow = True)
		#~ coolBar.AddSimpleRebarBandCtrl(aTrackBar, title = 'TrackBar', bNewRow = True)
		coolBar.SetRedraw(True)

		aList = list.List(parent = self, orExStyle = WS_EX_CLIENTEDGE)

		aList.InsertColumns([('blaat', 100), ('col2', 150)])
		aList.SetRedraw(0)
		for i in range(100):
			aList.InsertRow(i, ['blaat %d' % i, 'blaat col2 %d' % i])
		aList.SetRedraw(1)

		self.controls.Add(progressBar)
		self.controls.Add(addressBar)
		self.controls.Add(commandBar)
		self.controls.Add(buttons)
		self.controls.Add(aTrackBar)
		self.controls.Add(form.CTRL_COOLBAR, coolBar)
		self.controls.Add(form.CTRL_VIEW, aList)
		self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent = self))
 def OnCreate(self, event):
     self.list_view = comctl.ListView(parent=self,
                                      rcPos=RECT(
                                          5,
                                          10,
                                          200,
                                          100,
                                          orExStyle=WS_EX_CLIENTEDGE))
     self.controls.Add(form.CTRL_VIEW, self.list_view)
     self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
 def OnCreate(self, event):
     if str_parent_environment:
         st = comctl.StaticText(str_parent_environment, parent=self)
         self.controls.Add(form.CTRL_VIEW, st)
     else:
         cf = form.ClientForm(parent=self)
         btn = button('new process window', parent=cf, orStyle=BS_TEXT)
         cf.add((btn, (5, 5, 200, 25)))
         self.controls.Add(form.CTRL_VIEW, cf)
     self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
Beispiel #4
0
    def OnCreate(self, event):
        coolBar = coolbar.CoolBar(parent=self)

        commandBar = coolbar.CommandBar(parent=coolBar)
        commandBar.AttachMenu(self.menu)

        addressBar = comctl.ComboBox(parent=coolBar)

        buttons = coolbar.ToolBar(parent=coolBar)
        buttons.SetImageList(iml)
        buttons.SetButtonSize(32, 32)

        button = comctl.TBBUTTON()
        for i in range(10):
            button.iBitmap = 1 + i
            button.fsState = comctl.TBSTATE_ENABLED
            button.fsStyle = comctl.TBSTYLE_BUTTON
            buttons.InsertButton(0, button)

        progressBar = comctl.ProgressBar(parent=coolBar,
                                         orStyle=comctl.PBS_SMOOTH)
        progressBar.SetBarColor(gdi.RGB(100, 200, 255))
        progressBar.SetBkColor(gdi.RGB(55, 55, 55))
        progressBar.MoveWindow(0, 0, 200, 20, 0)
        progressBar.SetRange(0, 500)
        progressBar.SetPos(450)

        aTrackBar = MyTrackBar(parent=coolBar)
        aTrackBar.SetRange(0, 500)
        aTrackBar.SetPos(450)

        coolBar.SetRedraw(0)
        coolBar.AddSimpleRebarBandCtrl(commandBar)
        coolBar.AddSimpleRebarBandCtrl(buttons, bNewRow=True)
        coolBar.AddSimpleRebarBandCtrl(addressBar, bNewRow=True)
        coolBar.AddSimpleRebarBandCtrl(progressBar, bNewRow=True)
        coolBar.AddSimpleRebarBandCtrl(aTrackBar)
        coolBar.SetRedraw(1)

        aList = list.List(parent=self, orExStyle=WS_EX_CLIENTEDGE)

        aList.InsertColumns([("blaat", 100), ("col2", 150)])
        aList.SetRedraw(0)
        for i in range(100):
            aList.InsertRow(i, ["blaat %d" % i, "blaat col2 %d" % i])
        aList.SetRedraw(1)

        self.controls.Add(progressBar)
        self.controls.Add(addressBar)
        self.controls.Add(commandBar)
        self.controls.Add(buttons)
        self.controls.Add(aTrackBar)
        self.controls.Add(form.CTRL_VIEW, aList)
        self.controls.Add(form.CTRL_COOLBAR, coolBar)
        self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
Beispiel #5
0
    def OnCreate(self, event):
        self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))

        cc = CHOOSECOLOR()  # common dialog box structure
        acrCustClr = (COLORREF * 16)()  # array of custom colors
        hwnd = self.handle  # owner window
        # Initialize CHOOSECOLOR
        ZeroMemory(cc, sizeof(CHOOSECOLOR))
        cc.lStructSize = sizeof(CHOOSECOLOR)
        cc.hwndOwner = hwnd
        cc.lpCustColors = cast(acrCustClr, LPCOLORREF)
        cc.rgbResult = self.rgbCurrent
        cc.Flags = CC_FULLOPEN | CC_RGBINIT
        if ChooseColor(byref(cc)):
            #hbrush = gdi.CreateSolidBrush(cc.rgbResult)
            #hbrush = gdi.SolidBrush(cc.rgbResult)
            self.rgbCurrent = cc.rgbResult
Beispiel #6
0
    def OnCreate(self, event):
        aSplitter = splitter.Splitter(parent=self,
                                      orientation=splitter.HORIZONTAL,
                                      splitPos=int(self.clientRect.height *
                                                   0.7))

        aEditor = Editor(parent=aSplitter, orExStyle=WS_EX_CLIENTEDGE)
        aEditor.SetText(open(__file__, 'r').read())
        aConsole = Console(parent=aSplitter, orExStyle=WS_EX_CLIENTEDGE)

        aSplitter.Add(self._editors_count_, aEditor)
        self._editors_count_ += 1
        aSplitter.Add(self._editors_count_, aConsole)

        self.controls.Add(form.CTRL_VIEW, aSplitter)
        self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
        self.controls.Add(CTRL_EDITOR, aEditor)
        self.controls.Add(aConsole)
        self.console = aConsole
Beispiel #7
0
    def OnCreate(self, event):
        cool_bar = coolbar.CoolBar(parent=self)
        tool_bar = coolbar.ToolBar(parent=cool_bar,
                                   orStyle=comctl.TBSTYLE_TOOLTIPS)
        tool_bar.AddString(u'Open XPM\0Save TXT\0Exit\0')
        #~ tool_bar.SendMessage(comctl.TB_ADDSTRING, 0, u'Open\0Save\0Exit\0')
        #~ tool_bar.SetExtendedStyle(comctl.TBSTYLE_EX_MIXEDBUTTONS)
        #~ tool_bar.add_bitmap(comctl.IDB_STD_LARGE_COLOR)
        #~ tool_bar.add_bitmap(hex_to_bitmap(*xpm_data_to_hex(exit_xpm_data)), 0)
        #~ tool_bar.SendMessage(comctl.CCM_SETVERSION, 5)
        tool_bar.SetImageList(iml)
        #~ print iml.GetImageCount()
        #~ tool_bar.SetButtonSize(32, 32)
        idb = 0
        #~ tool_bar.SetButtonToolTip(0, 'Open XPM file')
        tool_bar.insert_button(form.ID_OPEN, 0, idb, comctl.STD_FILEOPEN)
        idb += 1
        tool_bar.insert_button(id_button=idb, fs_style=comctl.TBSTYLE_SEP)
        idb += 1
        tool_bar.insert_button(form.ID_SAVE, 1, idb, comctl.STD_FILESAVE)
        idb += 1
        tool_bar.insert_button(id_button=idb, fs_style=comctl.TBSTYLE_SEP)
        idb += 1
        tool_bar.insert_button(form.ID_CLOSE, 2, idb, 0)  #comctl.STD_DELETE
        # ======== TOOL TIPS
        tool_bar.SetToolTips(self.create_tool_tips(tool_bar))
        # =========
        cool_bar.SetRedraw(False)
        cool_bar.AddSimpleRebarBandCtrl(tool_bar)
        cool_bar.SetRedraw(True)
        self.controls.Add(tool_bar)
        self.controls.Add(form.CTRL_COOLBAR, cool_bar)

        self.output_text = comctl.Edit(
            parent=self,
            style=WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
            orStyle=WS_EX_CLIENTEDGE | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE
            | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_WANTRETURN)
        self.controls.Add(form.CTRL_VIEW, self.output_text)

        self.status_bar = comctl.StatusBar(parent=self)
        self.controls.Add(form.CTRL_STATUSBAR, self.status_bar)
Beispiel #8
0
    def OnCreate(self, event):
        self.sp = splitter.Splitter(splitPos=self.clientRect.width / 2,
                                    parent=self)

        self.fc = fern_canvas(parent=self.sp, orExStyle=WS_EX_STATICEDGE)
        self.sp.Add(1, self.fc)
        self.controls.Add(self.fc)

        self.prop = form.Form(parent=self.sp,
                              style=WS_CHILD | WS_VISIBLE,
                              orExStyle=WS_EX_STATICEDGE)
        self.prop._window_background_ = gdi.GetStockObject(gdi.LTGRAY_BRUSH)

        tb = track_bar(title=self.FMT_RECURSION % self.fc.maxLevels,
                       rcPos=RECT(5, 0, 300, 50),
                       parent=self.prop,
                       form=self)
        tb.SetRange(1, 10)
        tb.SetPos(self.fc.maxLevels)
        self.controls.Add(tb)

        tb = track_bar(title=self.FMT_BEND_ANGLE % self.fc.initBendAngle,
                       rcPos=RECT(5, 60, 300, 110),
                       parent=self.prop,
                       form=self)
        tb.SetRange(0, 120)
        tb.SetPos(self.fc.initBendAngle + 60)
        self.controls.Add(tb)

        tb = track_bar(title=self.FMT_BRANCH_ANGLE % self.fc.initBranchAngle,
                       rcPos=RECT(5, 120, 300, 170),
                       parent=self.prop,
                       form=self)
        tb.SetRange(0, 90)
        tb.SetPos(self.fc.initBranchAngle)
        self.controls.Add(tb)

        tb = track_bar(title=self.FMT_TRUNK_RATIO % self.fc.trunkRatio,
                       rcPos=RECT(5, 180, 300, 230),
                       parent=self.prop,
                       form=self)
        tb.SetRange(0, 75)
        tb.SetPos(int(self.fc.trunkRatio * 100))
        self.controls.Add(tb)

        tb = track_bar(title=self.FMT_BRANCH_RATIO % self.fc.branchRatio,
                       rcPos=RECT(5, 240, 300, 290),
                       parent=self.prop,
                       form=self)
        tb.SetRange(1, 20)
        tb.SetPos(int(self.fc.branchRatio * 10))
        self.controls.Add(tb)

        tb = track_bar(title=self.FMT_HEIGHT_SCALE % self.fc.heightScale,
                       rcPos=RECT(5, 300, 300, 350),
                       parent=self.prop,
                       form=self)
        tb.SetRange(1, 80)
        tb.SetPos(int(self.fc.heightScale * 10))
        self.controls.Add(tb)

        self.sp.Add(0, self.prop)

        self.controls.Add(form.CTRL_VIEW, self.sp)
        self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
Beispiel #9
0
 def OnCreate(self, event):
     self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))
Beispiel #10
0
 def OnCreate(self, event):
     canvas = Canvas(parent=self)
     self.controls.Add(form.CTRL_VIEW, canvas)
     self.controls.Add(form.CTRL_STATUSBAR, comctl.StatusBar(parent=self))