def __init__(self, prt): self._parent = prt self._list = [u"screencapture", u"shell", u"transfers"] self._sessions = False self._cmps = {} self._visible_cmps = {} self._screen_w = 0 self._screen_h = 0 self._dlg_w = 25 self._dlg = gdi.Window(gdi.WINDOW_TYPE_POPUP) self._dlg.set_background("ffaa33") self._pnl = gdi.Panel() self._pnl.set_position(1, 1) self._pnl.set_size(self._dlg_w, 24) self._pnl.set_background("313536") self._dlg.add_component(self._pnl) implogo = gdi.ImagePanel() implogo.set_position(4, 4) implogo.set_filename(images.get_image(u"logo16x16.bmp")) self._pnl.add_component(implogo) for k in self._list: self._visible_cmps[k] = False self._cmps[k] = gdi.ImagePanel() self._cmps[k].set_filename( images.get_image(u"activities_" + k + u".bmp")) self._dlg.add_component(self._cmps[k]) self._sessions_last_update = self._sessions self._visible_cmps_last_update = self._visible_cmps.copy() self._dlg.set_action(self.on_action)
rr.set_selected(True) ww.add_component(rr) pbr = gdi.ProgressBar() pbr.set_position(250, 250) pbr.set_percent(0.4) ww.add_component(pbr) pl = gdi.Panel() pl.set_position(0, 0) pl.set_size(90, ww.get_height()) pl.set_background_gradient("83e5ff", "FFFFFF", gdi.GRADIENT_DIRECTION_LEFTRIGHT) ww.add_component(pl) imp = gdi.ImagePanel() imp.set_position(200, 280) imp.set_filename(images.get_image("logo32x32.bmp")) ww.add_component(imp) pb = gdi.Panel() pb.set_position(0, ww.get_height() - 55) pb.set_size(ww.get_width(), 55) ww.add_component(pb) b1 = gdi.Button() b1.set_text("Message") b1.set_position(10, 10) b1.set_action(_test_other_window) pb.add_component(b1)
def _guimode_start(self): gdi.gdw_lib() #Se non è presente la libreria va in errore quindi in modalita console self._top_height=0 if self._topimage is not None: self._top_height=gdi.get_image_size(self._topimage)["height"] elif self._topinfo is not None: self._top_height=(22*len(self._topinfo.split("\n"))) + 10 self._app = gdi.Window(gdi.WINDOW_TYPE_NORMAL_NOT_RESIZABLE, logopath=self._logo) #self._app = Window(gdi.WINDOW_TYPE_NORMAL_NOT_RESIZABLE, logopath=self._logo) #self._app.setUI(self) self._app.set_title(self._title) self._app.set_size(_WIDTH, _HEIGHT+self._top_height) self._app.set_show_position(gdi.WINDOW_POSITION_CENTER_SCREEN) self._app.set_action(self._guimode_action) pnl_left = gdi.Panel(); pnl_left.set_position(0, self._top_height) pnl_left.set_size(_WIDTH_LEFT,_HEIGHT) if self._leftcolor is not None: pnl_left.set_background_gradient(self._leftcolor, "FFFFFF", gdi.GRADIENT_DIRECTION_LEFTRIGHT) else: pnl_left.set_background_gradient("83e5ff", "FFFFFF", gdi.GRADIENT_DIRECTION_LEFTRIGHT) self._app.add_component(pnl_left) if self._topimage is not None: pnl_top = gdi.ImagePanel(); pnl_top.set_position(0, 0) pnl_top.set_filename(self._topimage) pnl_top.set_size(_WIDTH,self._top_height) self._app.add_component(pnl_top) elif self._topinfo is not None: pnl_top = gdi.Panel(); pnl_top.set_position(0, 0) pnl_top.set_size(_WIDTH,self._top_height) pnl_top.set_background("d9d9d9") self._app.add_component(pnl_top) pnl_top_text = gdi.Label() pnl_top_text.set_position(10,0) pnl_top_text.set_size(_WIDTH-(2*10),self._top_height) pnl_top_text.set_wordwrap(True) pnl_top_text.set_foreground("000000") pnl_top_text.set_text(self._topinfo) pnl_top.add_component(pnl_top_text) pnl_bottom = gdi.Panel(); pnl_bottom.set_position(0, _CONTENT_HEIGHT+self._top_height) pnl_bottom.set_size(_WIDTH,_HEIGHT_BOTTOM) self._app.add_component(pnl_bottom) wbtn=140 hbtn=36 self._btback = gdi.Button(); self._btback.set_position(10, 10) self._btback.set_size(wbtn, hbtn) self._btback.set_text(messages.get_message('back')) self._btback.set_enable(False); self._btback.set_action(self._guimode_back) pnl_bottom.add_component(self._btback) self._btnext = gdi.Button(); self._btnext.set_position(10+wbtn+5, 10) self._btnext.set_size(wbtn, hbtn) self._btnext.set_text(messages.get_message('next')) self._btnext.set_enable(False); self._btnext.set_action(self._guimode_next) pnl_bottom.add_component(self._btnext) self._btclose = gdi.Button(); self._btclose.set_position(_WIDTH-wbtn-10, 10) self._btclose.set_size(wbtn, hbtn) self._btclose.set_text(messages.get_message('close')) self._btclose.set_enable(False); self._btclose.set_action(self._guimode_close) pnl_bottom.add_component(self._btclose) self._pnlmain=None self._cur_step_ui=None self._step_init_run=False self._guimode_step_init_start() self._app.show() gdi.loop()