def showExplain(self): filePath = os.path.join(os.path.dirname(__file__), "../conf/explain.ini") with open(filePath, 'r', encoding='utf-8-sig') as f: lineList = f.readlines() explainStr = "" for astr in lineList: explainStr += astr contentLayout = STableBoxLayout(size_hint=(1, 1), orientation="vertical") slview = STableScrollView(size_hint=(1, .92)) contentLayout.add_widget(slview) explainLayout = STableBoxLayout(size_hint=(1, None)) explainLayout.bind(minimum_height=explainLayout.setter('height')) explainLabel = SLabel(text=explainStr, size_hint=(1, None)) explainLabel.font_name = CONSTS.FONT_NAME explainLabel.color = colorHex("#000000") explainLayout.add_widget(explainLabel) slview.add_widget(explainLayout) bottomLayout = BoxLayout(size_hint=(1, .08)) closebtn_id = SButton(text="關閉", size_hint=(1, .8)) bottomLayout.add_widget(closebtn_id) contentLayout.add_widget(bottomLayout) popup = SPopup(title="股票代碼說明", content=contentLayout, size_hint=(None, None), size=(500, 400), auto_dismiss=False) closebtn_id.bind(on_press=popup.dismiss) popup.title_font = CONSTS.FONT_NAME popup.open()
def stradeCost(self): self.stcLayout = STradeCost({CONSTS.S_APP:self.app}) popup = SPopup(title="交易成本設定", content=self.stcLayout, size_hint=(None, None), size=(640, 480), auto_dismiss=False) self.stcLayout.closebtn_id.bind(on_press=popup.dismiss) popup.title_font = CONSTS.FONT_NAME popup.open()
def showSelectedOptionDesc(self): if self.optionList == None: return mainContent = BoxLayout(size_hint=(1, 1), orientation="vertical") slview = STableScrollView() slview.size_hint = (1, None) slview.size = (480, 160) contentLayout = STableGridLayout(cols=1, spacing=2, size_hint_y=None) # Make sure the height is such that there is something to scroll. contentLayout.bind(minimum_height=contentLayout.setter('height')) slview.add_widget(contentLayout) aLabel = None rowIndex = 0 for aObj in self.optionList: if aObj.isSelected() != True: continue rowIndex += 1 aStr = str(rowIndex) + ". " + aObj.getOptionDesc() aLabel = SLabel(text=aStr,size_hint=(1, None), height=30) aLabel.color = colorHex("#000000") contentLayout.add_widget(aLabel) showSelectFile_popup = SPopup(title="已選條件", content=mainContent, size_hint=(None, None), size=(480, 250), auto_dismiss=False) showSelectFile_popup.title_font = CONSTS.FONT_NAME mainContent.add_widget(slview) closeBtn = SButton(text="關閉") closeBtn.bind(on_press=showSelectFile_popup.dismiss) mainContent.add_widget(closeBtn) showSelectFile_popup.open()
def downloadData(self): downloadLayout = SDownload({CONSTS.S_APP: self.app}) popup = SPopup(title="下載歷史報價資料", content=downloadLayout, size_hint=(None, None), size=(540, 400), auto_dismiss=False) downloadLayout.closebtn_id.bind(on_press=popup.dismiss) popup.title_font = CONSTS.FONT_NAME popup.open()
def strategySetting(self, instance): self.removeMenu() self.ssyLayout = SStrategy({CONSTS.S_APP: self.app}) popup = SPopup(title="交易策略設定", content=self.ssyLayout, size_hint=(None, None), size=(640, 480), auto_dismiss=False) self.ssyLayout.closebtn_id.bind(on_press=popup.dismiss) popup.title_font = CONSTS.FONT_NAME popup.open()