OSDN Git Service

add seed1 gui xrc & revise other view xrc
authorkei9 <kei9@users.sourceforge.jp>
Sun, 15 Dec 2013 16:10:28 +0000 (01:10 +0900)
committerkei9 <kei9@users.sourceforge.jp>
Sun, 15 Dec 2013 16:10:28 +0000 (01:10 +0900)
split view controll class

amulettool.py
view/__init__.py
view/constnumbers.py
view/mainframe.xrc
view/mainframeview.py
view/notebookamuletview.py [new file with mode: 0644]
view/notebookflowview.py [new file with mode: 0644]
view/notebookseed1view.py [new file with mode: 0644]
view/notebookseed2view.py [new file with mode: 0644]
view/notebooksettingview.py [new file with mode: 0644]
view/notebookskill2view.py [new file with mode: 0644]

index b95ae2c..5a5c9c4 100644 (file)
@@ -47,7 +47,10 @@ class AmuletToolController(wx.App):
         self.frame_view.DisableNoteBook()
 
         self._init_database()
         self.frame_view.DisableNoteBook()
 
         self._init_database()
-        self._set_views()
+        self._init_notebook_seed2()
+        self._init_notebook_skill2()
+        self._init_notebook_setting()
+        self._init_notebook_amulet()
 
         self.frame_view.EnableNoteBook()
         return True
 
         self.frame_view.EnableNoteBook()
         return True
@@ -62,25 +65,6 @@ class AmuletToolController(wx.App):
         frame.Bind(wx.EVT_CLOSE, self.CloseHandler)
 
         # button event
         frame.Bind(wx.EVT_CLOSE, self.CloseHandler)
 
         # button event
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSeedSearch, id=self.frame_view.ID_BUTTON_SEED_SEARCH)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSeedClear, id=self.frame_view.ID_BUTTON_SEED_CLEAR)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSkillSearchFromSeed, id=self.frame_view.ID_BUTTON_SKILL_FROM_SEED_SEARCH)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSkillSearch, id=self.frame_view.ID_BUTTON_SKILL_SEARCH)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSkillClear, id=self.frame_view.ID_BUTTON_SKILL_CLEAR)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickAmuletSearch, id=self.frame_view.ID_BUTTON_AMULET_SEARCH_SEARCH)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickAmuletClear, id=self.frame_view.ID_BUTTON_AMULET_SEARCH_CLEAR)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSkillSearchFromAmulet, id=self.frame_view.ID_BUTTON_AMULET_SEARCH_SKILL)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSettingOK, id=self.frame_view.ID_BUTTON_SETTING_OK)
-        frame.Bind(wx.EVT_BUTTON, self.OnClickSettingClear, id=self.frame_view.ID_BUTTON_SETTING_CLEAR)
-
-        # radio button event
-        frame.Bind(wx.EVT_RADIOBUTTON, self.OnClickAmuletRadio, id=self.frame_view.ID_RADIO_BUTTON_AMULET1)
-        frame.Bind(wx.EVT_RADIOBUTTON, self.OnClickAmuletRadio, id=self.frame_view.ID_RADIO_BUTTON_AMULET2)
-        frame.Bind(wx.EVT_RADIOBUTTON, self.OnClickAmuletRadio, id=self.frame_view.ID_RADIO_BUTTON_AMULET3)
-
-        # combo box event
-        frame.Bind(wx.EVT_COMBOBOX, self.OnClickAmuletCombo, id=self.frame_view.ID_COMBO_BOX_AMULET_SEARCH_SKILL1)
-        frame.Bind(wx.EVT_COMBOBOX, self.OnClickAmuletCombo, id=self.frame_view.ID_COMBO_BOX_AMULET_SEARCH_SKILL2)
 
     def _init_database(self):
         u""" DBの初期設定 """
 
     def _init_database(self):
         u""" DBの初期設定 """
@@ -125,16 +109,12 @@ class AmuletToolController(wx.App):
             self._amulet_id2skill1_id_dict,
             self._amulet_id2skill2_id_dict) = self.db_accessor.get_dicts()
 
             self._amulet_id2skill1_id_dict,
             self._amulet_id2skill2_id_dict) = self.db_accessor.get_dicts()
 
-
-    def _set_views(self):
-        u""" GUIにDBの各種値をセットする """
-        self._set_combo_views()
-        self._set_spin_views()
-        self._set_check_list_views()
-
-    def _set_combo_views(self):
-        u""" ComboBoxの値をセットする """
-        combo_dict = self.frame_view.combo_box_skill_dict
+    def _init_notebook_seed2(self):
+        u""" Seed2特定タブのviewの初期化 """
+        self.notebook_seed2_view = self.frame_view.notebook_seed2_view
+        self.notebook_seed2_view.bind_button_search(self.OnClickSeed2Search)
+        self.notebook_seed2_view.bind_button_clear(self.OnClickSeed2Clear)
+        self.notebook_seed2_view.bind_button_skill2(self.OnClickSkill2SearchFromSeed2)
 
         u" 各種お守りの第2スキル選択 "
         for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
 
         u" 各種お守りの第2スキル選択 "
         for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
@@ -142,52 +122,43 @@ class AmuletToolController(wx.App):
             amu_id = self._amulet_name2id_dict[amu_name]
             skill_ids = self._amulet_id2skill2_id_dict[amu_id]
             skill_names = [view.VAL_NO_SKILL] + [self._skill_id2name_dict[x] for x in skill_ids]
             amu_id = self._amulet_name2id_dict[amu_name]
             skill_ids = self._amulet_id2skill2_id_dict[amu_id]
             skill_names = [view.VAL_NO_SKILL] + [self._skill_id2name_dict[x] for x in skill_ids]
-            for combo in combo_dict[amu_key]:
-               combo.SetItems(skill_names)
-               combo.SetSelection(0)
+            self.notebook_seed2_view.set_skill_names(amu_key, skill_names)
+        self.notebook_seed2_view.set_skill_selected_idx(0)
+
+    def _init_notebook_skill2(self):
+        u""" Seed2によるSkill2一覧タブのviewの初期化 """
+        self.notebook_skill2_view = self.frame_view.notebook_skill2_view
+        self.notebook_skill2_view.bind_button_search(self.OnClickSkillSearch)
+        self.notebook_skill2_view.bind_button_clear(self.OnClickSkillClear)
+
+    def _update_notebook_amulet(self, amulet_id=None):
+        u""" お守り検索タブのviewの更新
+        amulet_id が Noneでない場合、お守りの種類に応じてComboboxを再設定する
+        また、選択中のスキルに応じて最大最小を設定する"""
+        #min1, max1, min2, max2 = self.db_accessor.get_skill_minmax()
+        #self.notebook_amulet_view.set_skill_minmax(min1, max1, min2, max2)
+
+        if amulet_id is not None:
+            for i, skill_dict in enumerate([self._amulet_id2skill1_id_dict, self._amulet_id2skill2_id_dict]):
+                skill_ids = skill_dict[amulet_id]
+                skill_names = [self._skill_id2name_dict[_id] for _id in skill_ids]
+                if i == 0:
+                    self.notebook_amulet_view.set_items_skill1_combobox(skill_names)
+                    skill1_selected = skill_ids[0]
+                    self.notebook_amulet_view.set_selection_skill1_combobox(0)
+                elif i == 1:
+                    self.notebook_amulet_view.set_items_skill2_combobox([view.VAL_NO_SKILL] + skill_names)
+                    self.notebook_amulet_view.set_selection_skill2_combobox(0)  # select No Skill
+        else:
+            amulet_name = self.notebook_amulet_view.get_selected_radio_name()
+            amulet_id = self._amulet_name2id_dict[amulet_name]
+
+        # settting min max
+        skill1_str = self.notebook_amulet_view.get_string_selection_skill1_combobox()
+        skill2_str = self.notebook_amulet_view.get_string_selection_skill2_combobox()
+        skill1_id = self._skill_name2id_dict[skill1_str] if skill1_str in self._skill_name2id_dict else None
+        skill2_id = self._skill_name2id_dict[skill2_str] if skill2_str in self._skill_name2id_dict else None
 
 
-        # amulet search
-        amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
-        self._set_skill_list_from_amulet(amu_id)
-        self.frame_view.amulet2radio_button_dict[view.NAME_AMULET1].SetValue(True)
-
-    def _set_skill_list_from_amulet(self, amulet_id):
-        u""" お守り種類の選択が変わった時の動作 """
-
-        for i, (combo, skill_dict) in enumerate(zip(
-                [self.frame_view.combo_box_amulet_search_skill1, 
-                    self.frame_view.combo_box_amulet_search_skill2], 
-                [self._amulet_id2skill1_id_dict, self._amulet_id2skill2_id_dict]
-                )):
-            skill_ids = skill_dict[amulet_id]
-            skill_names = [self._skill_id2name_dict[_id] for _id in skill_ids]
-            if i == 0:
-                combo.SetItems(skill_names)
-                skill1_selected = skill_ids[0]
-            elif i == 1:
-                combo.SetItems([view.VAL_NO_SKILL] + skill_names)
-            else:
-                raise NotImplementedError(u"this iteration must be conducted only twice!")
-            combo.SetSelection(0)   # combo1 = skill1, combo2 = No Skill
-        self._set_spin_range(amulet_id, skill1_selected, None)
-
-    def _set_spin_views(self):
-        u""" Spin Ctrlの最大最小をセット"""
-        min1, max1, min2, max2 = self.db_accessor.get_skill_minmax()
-        self.frame_view.spin_ctrl_amulet_search_slot_num.SetRange(view.SLOT_MIN, view.SLOT_MAX)
-        self.frame_view.spin_ctrl_highlight1.SetRange(view.THRESHOLD1_MIN, view.THRESHOLD1_MAX)
-        self.frame_view.spin_ctrl_highlight2.SetRange(view.THRESHOLD2_MIN, view.THRESHOLD2_MAX)
-        self.frame_view.spin_ctrl_highlight1.SetValue(self._highlight_threshold1)
-        self.frame_view.spin_ctrl_highlight2.SetValue(self._highlight_threshold2)
-
-    def _set_check_list_views(self):
-        u""" CheckListBoxの値のセット """
-        checklist = self.frame_view.check_list_box_highlight_skill
-        checklist.SetItems(self._skill_name2id_dict.keys())
-        checklist.SetCheckedStrings([self._skill_id2name_dict[x] for x in self._highlight_skills])
-
-    def _set_spin_range(self, amulet_id, skill1_id, skill2_id):
-        u""" スキルに応じてSpinCtrlの最大最小をセットする """
         if skill2_id is None:
             minmax_dict = self.db_accessor.select_minmax_from_skill_ids(amulet_id, [skill1_id])
             min1, max1 = minmax_dict[skill1_id][0], minmax_dict[skill1_id][1]
         if skill2_id is None:
             minmax_dict = self.db_accessor.select_minmax_from_skill_ids(amulet_id, [skill1_id])
             min1, max1 = minmax_dict[skill1_id][0], minmax_dict[skill1_id][1]
@@ -196,135 +167,125 @@ class AmuletToolController(wx.App):
             minmax_dict = self.db_accessor.select_minmax_from_skill_ids(amulet_id, [skill1_id, skill2_id])
             min1, max1 = minmax_dict[skill1_id][0], minmax_dict[skill1_id][1]
             min2, max2 = minmax_dict[skill2_id][2], minmax_dict[skill2_id][3]
             minmax_dict = self.db_accessor.select_minmax_from_skill_ids(amulet_id, [skill1_id, skill2_id])
             min1, max1 = minmax_dict[skill1_id][0], minmax_dict[skill1_id][1]
             min2, max2 = minmax_dict[skill2_id][2], minmax_dict[skill2_id][3]
-        self.frame_view.spin_ctrl_amulet_search_skill1_val.SetRange(min1, max1)
-        self.frame_view.spin_ctrl_amulet_search_skill2_val.SetRange(min2, max2)
+        self.notebook_amulet_view.set_skill_minmax(min1, max1, min2, max2)
 
 
-    def OnClickSeedSearch(self, evt):
-        u""" search seeds from selected skills """
+    def _init_notebook_amulet(self):
+        u""" お守り検索タブの初期設定 """
+        self.notebook_amulet_view = self.frame_view.notebook_amulet_view
+        self.notebook_amulet_view.bind_radio_button(self.OnClickAmuletRadio)
+        self.notebook_amulet_view.bind_combobox(self.OnClickAmuletCombo)
+        self.notebook_amulet_view.bind_button_search(self.OnClickAmuletSearch)
+        self.notebook_amulet_view.bind_button_clear(self.OnClickAmuletClear)
+        self.notebook_amulet_view.bind_button_skill(self.OnClickSkillSearchFromAmulet)
+
+        amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
+        self.notebook_amulet_view.set_radio_value(True, view.NAME_AMULET1)
+        self._update_notebook_amulet(amu_id)
+
+    def _init_notebook_setting(self):
+        u""" 設定タブの初期設定 """
+        self.notebook_setting_view = self.frame_view.notebook_setting_view
+        self.notebook_setting_view.bind_button_ok(self.OnClickSettingOK)
+        self.notebook_setting_view.bind_button_clear(self.OnClickSettingClear)
+        self.notebook_setting_view.set_skill_strings(self._skill_name2id_dict.keys())
+        self._update_notebook_setting()
+
+    def _update_notebook_setting(self):
+        u"""設定タブの値更新"""
+        self.notebook_setting_view.set_threshold(self._highlight_threshold1, 
+                self._highlight_threshold2)
+        self.notebook_setting_view.set_checked_strings([self._skill_id2name_dict[x] for x in self._highlight_skills])
+
+    def _update_highlight(self):
+        u""" update highlight cells """
+        skill_names = [self._skill_id2name_dict[x] for x in self._highlight_skills]
+        self.notebook_skill2_view.set_skill2_highlight(
+                skill_names, self._highlight_threshold1, self._highlight_threshold2)
+
+    def OnClickSeed2Search(self, evt):
+        u""" search seed2s from selected skill2s """
         amu_id2skill_id_list_dict = {}
         for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
                 [view.NAME_AMULET1, view.NAME_AMULET2, view.NAME_AMULET3]):
             amu_id = self._amulet_name2id_dict[amu_name]
         amu_id2skill_id_list_dict = {}
         for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
                 [view.NAME_AMULET1, view.NAME_AMULET2, view.NAME_AMULET3]):
             amu_id = self._amulet_name2id_dict[amu_name]
-            ls = []
-            for combo in self.frame_view.combo_box_skill_dict[amu_key]:
-                name = combo.GetStringSelection()
-                if name not in self._skill_name2id_dict:
-                    ls.append(None)
-                else:
-                    ls.append(self._skill_name2id_dict[name])
+            names = self.notebook_seed2_view.get_selected_skill_names(amu_key)
+            ls = [self._skill_name2id_dict[name] if name in self._skill_name2id_dict else None 
+                    for name in names]
             amu_id2skill_id_list_dict[amu_id] = ls
         seed_sets = self.db_accessor.select_seeds(amu_id2skill_id_list_dict)
             amu_id2skill_id_list_dict[amu_id] = ls
         seed_sets = self.db_accessor.select_seeds(amu_id2skill_id_list_dict)
-        self.frame_view.text_ctrl_seed_result.SetValue(u"""Seedの候補は{0}個です。""".format(len(seed_sets)))
+        self.notebook_seed2_view.set_result_text(u"""Seedの候補は{0}個です。""".format(len(seed_sets)))
 
         if len(seed_sets) > 0:
 
         if len(seed_sets) > 0:
-            self.frame_view.list_box_seed.SetItems([u"{0}".format(seed) for seed in seed_sets])
-            self.frame_view.list_box_seed.SetSelection(0)
-            self.frame_view.button_skill_from_seed_search.Enable()
+            self.notebook_seed2_view.set_seed_lists([u"{0}".format(seed) for seed in seed_sets])
+            self.notebook_seed2_view.set_skill2_button_enable(True)
         else:
         else:
-            self.frame_view.list_box_seed.Clear()
-
-
-    def OnClickSeedClear(self, evt):
-        u""" reset seed search settings of combo box"""
-        combo_dict = self.frame_view.combo_box_skill_dict
-        for amu_key in [view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3]:
-            for combo in combo_dict[amu_key]:
-                combo.SetSelection(0)
-        self.frame_view.text_ctrl_seed_result.SetValue(u"")
-        self.frame_view.button_skill_from_seed_search.Disable()
-        self.frame_view.list_box_seed.Clear()
-
-    def OnClickSkillSearchFromSeed(self, evt):
-        u""" change page to skill search from seed"""
-        seed = self.frame_view.list_box_seed.GetStringSelection()
-        if seed.isdigit():
-            self.frame_view.text_ctrl_seed_select.SetValue(seed)
+            self.notebook_seed2_view.clear_seed_list()
+            self.notebook_seed2_view.set_skill2_button_enable(False)
+
+    def OnClickSeed2Clear(self, evt):
+        u""" reset seed2 search settings of combo box"""
+        self.notebook_seed2_view.set_skill_selected_idx(0)
+        self.notebook_seed2_view.clear_seed_list()
+        self.notebook_seed2_view.set_result_text(u"")
+        self.notebook_seed2_view.set_skill2_button_enable(False)
+
+    def OnClickSkill2SearchFromSeed2(self, evt):
+        u""" change page to skill2 search from seed2"""
+        seed2 = self.notebook_seed2_view.get_selected_seed2()
+        if seed2 is not None:
+            self.notebook_skill2_view.set_seed2_value(seed2)
             self.frame_view.note_book.SetSelection(view.SKILL_SEARCH_PAGE)
             self.OnClickSkillSearch(evt)
 
     def OnClickSkillSearch(self, evt):
         u""" skill search from seed"""
             self.frame_view.note_book.SetSelection(view.SKILL_SEARCH_PAGE)
             self.OnClickSkillSearch(evt)
 
     def OnClickSkillSearch(self, evt):
         u""" skill search from seed"""
-        seed = self.frame_view.text_ctrl_seed_select.GetValue()
-        if seed.isdigit():
-            seed = int(seed)
+        seed = self.notebook_skill2_view.get_seed2_value()
+        if seed is not None:
             skill_dict, threshold1_dict = self.db_accessor.select_skills_from_seeds([seed])
             skill_dict, threshold1_dict = self.db_accessor.select_skills_from_seeds([seed])
-            grid = self.frame_view.skill2_grid
             try:
                 for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
             try:
                 for amu_key, amu_name in zip([view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3], 
-                    [view.NAME_AMULET1, view.NAME_AMULET2, view.NAME_AMULET3]):
+                        [view.NAME_AMULET1, view.NAME_AMULET2, view.NAME_AMULET3]):
                     amu_id = self._amulet_name2id_dict[amu_name]
                     amu_id = self._amulet_name2id_dict[amu_name]
-                    amu_col = view.DICT_SKILL2_GRID_COL[amu_key]
-                    for row, skill_id in enumerate(skill_dict[amu_id][seed]):
-                        grid.SetCellValue(row, amu_col, self._skill_id2name_dict[skill_id])
-                th1_col = view.DICT_SKILL2_GRID_COL[view.KEY_THRESHOLD1]
-                for row, threshold1 in enumerate(threshold1_dict[seed]):
-                    grid.SetCellValue(row, th1_col, u"{0}".format(threshold1))
-                self._update_highlight()
-
+                    skill_names = [self._skill_id2name_dict[x] for x in skill_dict[amu_id][seed]]
+                    self.notebook_skill2_view.set_skill2_by_col_key(amu_key, skill_names)
+                th_vals = [u"{0}".format(x) for x in threshold1_dict[seed]]
+                self.notebook_skill2_view.set_skill2_by_col_key(view.KEY_THRESHOLD1, th_vals)
             except KeyError, e:
                 self._show_message_dialog(message=u"指定されたSeed値は存在しません")
             except KeyError, e:
                 self._show_message_dialog(message=u"指定されたSeed値は存在しません")
+            finally:
+                self._update_highlight()
+
         else:
             self._show_message_dialog(message=u"Seed値には数字を入力してください")
 
     def OnClickSkillClear(self, evt):
         u""" clear skills from seed """
         else:
             self._show_message_dialog(message=u"Seed値には数字を入力してください")
 
     def OnClickSkillClear(self, evt):
         u""" clear skills from seed """
-
-        grid = self.frame_view.skill2_grid
-        for row in range(view.NUM_SKILL2_GRID_ROW):
-            for col in range(view.NUM_SKILL2_GRID_COL):
-                grid.SetCellValue(row, col, "")
-        self.frame_view.list_box_seed_skill_amulet_prospect.Clear() 
-        self._update_highlight()
+        self.notebook_skill2_view.clear_skill2_grid()
+        self.notebook_skill2_view.clear_skill2_highlight()
+        self.notebook_skill2_view.clear_items_amulet_prospects()
 
     def OnClickAmuletRadio(self, evt):
         u""" switch skill lists by amulet id """
 
     def OnClickAmuletRadio(self, evt):
         u""" switch skill lists by amulet id """
-        btn_id = evt.GetId()
-        if btn_id == self.frame_view.ID_RADIO_BUTTON_AMULET1:
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
-        elif btn_id == self.frame_view.ID_RADIO_BUTTON_AMULET2:
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET2]
-        elif btn_id == self.frame_view.ID_RADIO_BUTTON_AMULET3:
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET3]
-        else:
-            return
-        self._set_skill_list_from_amulet(amu_id)
+        #btn_id = evt.GetId()
+        amulet_name = self.notebook_amulet_view.get_selected_radio_name()
+        amu_id = self._amulet_name2id_dict[amulet_name]
+        self._update_notebook_amulet(amu_id)
+        self.notebook_amulet_view.set_result_text_ctrl_value(u"")
+        self.notebook_amulet_view.set_skill_button_enable(False)
+        self.notebook_amulet_view.clear_listbox_items()
 
     def OnClickAmuletCombo(self, evt):
         u""" switch skill minmax by amulet id and skill_id"""
 
     def OnClickAmuletCombo(self, evt):
         u""" switch skill minmax by amulet id and skill_id"""
-        skill1_name = self.frame_view.combo_box_amulet_search_skill1.GetStringSelection()
-        skill2_name = self.frame_view.combo_box_amulet_search_skill2.GetStringSelection()
-        skill1_id = self._skill_name2id_dict[skill1_name]
-        if skill2_name in self._skill_name2id_dict:
-            skill2_id = self._skill_name2id_dict[skill2_name]
-        else:
-            skill2_id = None
-        if self.frame_view.amulet2radio_button_dict[view.NAME_AMULET1].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
-        elif self.frame_view.amulet2radio_button_dict[view.NAME_AMULET2].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET2]
-        elif self.frame_view.amulet2radio_button_dict[view.NAME_AMULET3].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET3]
-        else:
-            raise IndexError(u"amulet id is unknown")
-        self._set_spin_range(amu_id, skill1_id, skill2_id)
+        self._update_notebook_amulet()
 
     def OnClickAmuletSearch(self, evt):
         u""" search seeds from amulet condition """
 
     def OnClickAmuletSearch(self, evt):
         u""" search seeds from amulet condition """
-        skill1_name = self.frame_view.combo_box_amulet_search_skill1.GetStringSelection()
-        skill2_name = self.frame_view.combo_box_amulet_search_skill2.GetStringSelection()
-        skill1_val = self.frame_view.spin_ctrl_amulet_search_skill1_val.GetValue()
-        skill2_val = self.frame_view.spin_ctrl_amulet_search_skill2_val.GetValue()
-        slot_val = self.frame_view.spin_ctrl_amulet_search_slot_num.GetValue()
-        if self.frame_view.amulet2radio_button_dict[view.NAME_AMULET1].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
-        elif self.frame_view.amulet2radio_button_dict[view.NAME_AMULET2].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET2]
-        elif self.frame_view.amulet2radio_button_dict[view.NAME_AMULET3].GetValue():
-            amu_id = self._amulet_name2id_dict[view.NAME_AMULET3]
-        else:
-            raise IndexError(u"amulet id is unknown")
+        skill1_name, skill2_name = self.notebook_amulet_view.get_string_selection_skill_names()
+        skill1_val, skill2_val = self.notebook_amulet_view.get_skill_values()
+        slot_val = self.notebook_amulet_view.get_slot_value()
+        amulet_name = self.notebook_amulet_view.get_selected_radio_name()
+        amu_id = self._amulet_name2id_dict[amulet_name]
 
 
-        list_box = self.frame_view.list_box_amulet_search_seeds
         if skill1_name == skill2_name:
             self._show_message_dialog(message=u"異なるスキルを選択してください")
         elif skill1_val == 0:
         if skill1_name == skill2_name:
             self._show_message_dialog(message=u"異なるスキルを選択してください")
         elif skill1_val == 0:
@@ -342,45 +303,46 @@ class AmuletToolController(wx.App):
                 suff_val = tup[0]
                 seeds_set = self.db_accessor.select_seeds_from_sufficient_val(amu_id, suff_val, slot_val, skill2_id)
                 if len(seeds_set) > 0:
                 suff_val = tup[0]
                 seeds_set = self.db_accessor.select_seeds_from_sufficient_val(amu_id, suff_val, slot_val, skill2_id)
                 if len(seeds_set) > 0:
-                    self.frame_view.text_ctrl_amulet_search_result.SetValue(
+                    self.notebook_amulet_view.set_result_text_ctrl_value(
                         u"{0}個のSeedで出現するお守りです".format(len(seeds_set)))
                         u"{0}個のSeedで出現するお守りです".format(len(seeds_set)))
-                    list_box.SetItems([u"{0}".format(seed) for seed in seeds_set])
-                    list_box.SetSelection(0)
-                    self.frame_view.button_amulet_search_skill.Enable()
+                    self.notebook_amulet_view.set_listbox_items(
+                            [u"{0}".format(seed) for seed in seeds_set])
+                    self.notebook_amulet_view.set_selection_listbox(0)
+                    self.notebook_amulet_view.set_skill_button_enable(True)
                 else:
                 else:
-                    self.frame_view.text_ctrl_amulet_search_result.SetValue(
+                    self.notebook_amulet_view.set_result_text_ctrl_value(
                         u"指定されたお守りは見つかりませんでした")
                         u"指定されたお守りは見つかりませんでした")
-                    self.frame_view.button_amulet_search_skill.Disable()
-                    list_box.Clear()
+                    self.notebook_amulet_view.set_skill_button_enable(False)
+                    self.notebook_amulet_view.clear_listbox_items()
             else:
             else:
-                self.frame_view.text_ctrl_amulet_search_result.SetValue(
+                self.notebook_amulet_view.set_result_text_ctrl_value(
                     u"エラー。充足値が計算できません")
                     u"エラー。充足値が計算できません")
-                self.frame_view.button_amulet_search_skill.Disable()
-                list_box.Clear()
+                self.notebook_amulet_view.set_skill_button_enable(False)
+                self.notebook_amulet_view.clear_listbox_items()
 
     def OnClickAmuletClear(self, evt):
         u""" clear amulet conditions """
 
     def OnClickAmuletClear(self, evt):
         u""" clear amulet conditions """
+        self.notebook_amulet_view.set_radio_value(True, view.NAME_AMULET1)
         amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
         amu_id = self._amulet_name2id_dict[view.NAME_AMULET1]
-        self._set_skill_list_from_amulet(amu_id)
-        self.frame_view.amulet2radio_button_dict[view.NAME_AMULET1].SetValue(True)
-        self.frame_view.button_amulet_search_skill.Disable()
-        self.frame_view.text_ctrl_amulet_search_result.SetValue(u"")
-        self.frame_view.list_box_amulet_search_seeds.Clear()
+        self._update_notebook_amulet(amu_id)
+        self.notebook_amulet_view.set_skill_button_enable(False)
+        self.notebook_amulet_view.set_result_text_ctrl_value(u"")
+        self.notebook_amulet_view.clear_listbox_items()
 
     def OnClickSkillSearchFromAmulet(self, evt):
         u""" change page to skill search from amulet"""
 
     def OnClickSkillSearchFromAmulet(self, evt):
         u""" change page to skill search from amulet"""
-        seed = self.frame_view.list_box_amulet_search_seeds.GetStringSelection()
+        seed = self.notebook_amulet_view.get_string_selection_listbox()
         if seed.isdigit():
         if seed.isdigit():
-            self.frame_view.text_ctrl_seed_select.SetValue(seed)
+            self.notebook_skill2_view.set_seed2_value(seed)
             self.frame_view.note_book.SetSelection(view.SKILL_SEARCH_PAGE)
             self.OnClickSkillSearch(evt)
 
     def OnClickSettingOK(self, evt):
         u""" get settings of setting tab """
             self.frame_view.note_book.SetSelection(view.SKILL_SEARCH_PAGE)
             self.OnClickSkillSearch(evt)
 
     def OnClickSettingOK(self, evt):
         u""" get settings of setting tab """
-        self._highlight_threshold1 = self.frame_view.spin_ctrl_highlight1.GetValue()
-        self._highlight_threshold2 = self.frame_view.spin_ctrl_highlight2.GetValue()
+        (self._highlight_threshold1, 
+                self._highlight_threshold2) = self.frame_view.notebook_setting_view.get_threshold()
         self._highlight_skills = set([self._skill_name2id_dict[x] for x in 
         self._highlight_skills = set([self._skill_name2id_dict[x] for x in 
-                self.frame_view.check_list_box_highlight_skill.GetCheckedStrings()
+                self.frame_view.notebook_setting_view.get_checked_strings()
                 if x in self._skill_name2id_dict])
         self._update_highlight()
 
                 if x in self._skill_name2id_dict])
         self._update_highlight()
 
@@ -388,33 +350,10 @@ class AmuletToolController(wx.App):
         u""" reset settings of setting tab """
         self._highlight_threshold1 = view.HIGHLIGHT_THRESHOLD1
         self._highlight_threshold2 = view.HIGHLIGHT_THRESHOLD2
         u""" reset settings of setting tab """
         self._highlight_threshold1 = view.HIGHLIGHT_THRESHOLD1
         self._highlight_threshold2 = view.HIGHLIGHT_THRESHOLD2
-        self.frame_view.spin_ctrl_highlight1.SetValue(view.HIGHLIGHT_THRESHOLD1)
-        self.frame_view.spin_ctrl_highlight2.SetValue(view.HIGHLIGHT_THRESHOLD2)
         self._highlight_skills = set()
         self._highlight_skills = set()
-        for idx in self.frame_view.check_list_box_highlight_skill.GetChecked():
-            self.frame_view.check_list_box_highlight_skill.Check(idx, False)
+        self._update_notebook_setting()
         self._update_highlight()
 
         self._update_highlight()
 
-    def _update_highlight(self):
-        u""" update highlight cells """
-        grid = self.frame_view.skill2_grid
-        for key in [view.KEY_AMULET1, view.KEY_AMULET2, view.KEY_AMULET3]:
-            col = view.DICT_SKILL2_GRID_COL[key]
-            for row in range(view.NUM_SKILL2_GRID_ROW):
-                val = grid.GetCellValue(row, col)
-                if (val in self._skill_name2id_dict and
-                        self._skill_name2id_dict[val] in self._highlight_skills):
-                    grid.SetCellBackgroundColour(row, col, "Yellow")
-                else:
-                    grid.SetCellBackgroundColour(row, col, wx.NullColor)
-        col = view.DICT_SKILL2_GRID_COL[view.KEY_THRESHOLD1]
-        for row in range(view.NUM_SKILL2_GRID_ROW):
-            val = grid.GetCellValue(row, col)
-            if val.isdigit() and int(val) >= self._highlight_threshold1:
-                grid.SetCellBackgroundColour(row, col, "Yellow")
-            else:
-                grid.SetCellBackgroundColour(row, col, wx.NullColor)
-
 
     def _show_error_dialog(self, message=u"予期せぬエラーが発生しました", caption=u"エラー"):
         u""" エラーダイアログを表示し、
 
     def _show_error_dialog(self, message=u"予期せぬエラーが発生しました", caption=u"エラー"):
         u""" エラーダイアログを表示し、
index fa1cda1..a76853d 100644 (file)
@@ -1,8 +1,15 @@
 # -*- coding: utf-8 -*-
 
 # GUIのViewモジュール
 # -*- coding: utf-8 -*-
 
 # GUIのViewモジュール
-# 2013/12/05 written by kei9
+# 2013/12/15 written by kei9
 
 from mainframeview import MainFrameView
 from gaugedialogview import GaugeDialogView
 from constnumbers import *
 
 from mainframeview import MainFrameView
 from gaugedialogview import GaugeDialogView
 from constnumbers import *
+
+from notebookflowview import NoteBookFlowView
+from notebooksettingview import NoteBookSettingView
+from notebookseed1view import NoteBookSeed1View
+from notebookseed2view import NoteBookSeed2View
+from notebookskill2view import NoteBookSkill2View
+from notebookamuletview import NoteBookAmuletView
index b931ce5..53d5fcf 100644 (file)
@@ -15,11 +15,19 @@ KEY_AMULET3 = u"amulet3"
 KEY_THRESHOLD1 = u"threshold1"
 KEY_THRESHOLD2 = u"threshold2"
 
 KEY_THRESHOLD1 = u"threshold1"
 KEY_THRESHOLD2 = u"threshold2"
 
+# skill2 grid
 DICT_SKILL2_GRID_COL = {KEY_AMULET1:0, KEY_AMULET2:1, KEY_AMULET3:2, KEY_THRESHOLD1:3, KEY_THRESHOLD2:4}
 DICT_SKILL2_GRID_COL = {KEY_AMULET1:0, KEY_AMULET2:1, KEY_AMULET3:2, KEY_THRESHOLD1:3, KEY_THRESHOLD2:4}
-
 NUM_SKILL2_GRID_COL = 5
 NUM_SKILL2_GRID_ROW = 7
 LABEL_FORMAT_SKILL2_GRID_ROW = u"{0}枠目"
 NUM_SKILL2_GRID_COL = 5
 NUM_SKILL2_GRID_ROW = 7
 LABEL_FORMAT_SKILL2_GRID_ROW = u"{0}枠目"
+NUM_SEED1_GRID_COL = 7
+
+# seed1 grid
+LABEL_FORMAT_SEED1_GRID_ROW = u"No. {0}"
+LABEL_FORMAT_SEED1_GRID_COL1 = u"個数"
+LABEL_FORMAT_SEED1_GRID_COL_AFTER1 = u"{0}枠目"
+NUM_SEED1_GRID_COL = 8
+NUM_SEED1_GRID_ROW = 50
 
 VAL_NO_SKILL = u"なし"
 
 
 VAL_NO_SKILL = u"なし"
 
@@ -29,6 +37,11 @@ SKILL_SEARCH_PAGE = 1
 SLOT_MIN = 1
 SLOT_MAX = 3
 
 SLOT_MIN = 1
 SLOT_MAX = 3
 
+# amulet number of result
+AMULET_NUM_MIN = 3
+AMULET_NUM_MAX = 7
+
+# highlight
 HIGHLIGHT_THRESHOLD1 = 90
 THRESHOLD1_MIN = 0
 THRESHOLD1_MAX = 100
 HIGHLIGHT_THRESHOLD1 = 90
 THRESHOLD1_MIN = 0
 THRESHOLD1_MAX = 100
index 5da07a0..b615d17 100644 (file)
@@ -26,7 +26,7 @@
                        <object class="notebookpage">
                                <label>Seed2の特定</label>
                                <selected>0</selected>
                        <object class="notebookpage">
                                <label>Seed2の特定</label>
                                <selected>0</selected>
-                               <object class="wxPanel" name="NoteBookPanelSeed">
+                               <object class="wxPanel" name="NoteBookPanelSeed2">
                                        <style>wxTAB_TRAVERSAL</style>
                                        <object class="wxBoxSizer">
                                                <orient>wxHORIZONTAL</orient>
                                        <style>wxTAB_TRAVERSAL</style>
                                        <object class="wxBoxSizer">
                                                <orient>wxHORIZONTAL</orient>
@@ -41,7 +41,7 @@
                                                                        <option>1</option>
                                                                        <flag>wxEXPAND</flag>
                                                                        <border>0</border>
                                                                        <option>1</option>
                                                                        <flag>wxEXPAND</flag>
                                                                        <border>0</border>
-                                                                       <object class="wxTextCtrl" name="TextCtrlSeedExplain">
+                                                                       <object class="wxTextCtrl" name="TextCtrlSeed2Explain">
                                                                                <style>wxTE_MULTILINE|wxTE_READONLY</style>
                                                                                <value>explain text of seed decision</value>
                                                                                <maxlength>0</maxlength>
                                                                                <style>wxTE_MULTILINE|wxTE_READONLY</style>
                                                                                <value>explain text of seed decision</value>
                                                                                <maxlength>0</maxlength>
                        </object>
                        <object class="notebookpage">
                                <label>Seed2対応スキル</label>
                        </object>
                        <object class="notebookpage">
                                <label>Seed2対応スキル</label>
-                               <selected>1</selected>
+                               <selected>0</selected>
                                <object class="wxPanel" name="NoteBookPanelSkill">
                                        <style>wxTAB_TRAVERSAL</style>
                                        <object class="wxBoxSizer">
                                <object class="wxPanel" name="NoteBookPanelSkill">
                                        <style>wxTAB_TRAVERSAL</style>
                                        <object class="wxBoxSizer">
                                                                        <object class="wxBoxSizer">
                                                                                <orient>wxVERTICAL</orient>
                                                                                <object class="sizeritem">
                                                                        <object class="wxBoxSizer">
                                                                                <orient>wxVERTICAL</orient>
                                                                                <object class="sizeritem">
-                                                                                       <option>2</option>
+                                                                                       <option>1</option>
+                                                                                       <flag>wxEXPAND|wxLEFT|wxRIGHT</flag>
+                                                                                       <border>10</border>
+                                                                                       <object class="wxTextCtrl" name="TextCtrlSkillResult">
+                                                                                               <style>wxTE_MULTILINE|wxTE_READONLY</style>
+                                                                                               <value></value>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="sizeritem">
+                                                                                       <option>3</option>
                                                                                        <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
                                                                                        <border>10</border>
                                                                                        <object class="wxStaticBoxSizer">
                                                                                        <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
                                                                                        <border>10</border>
                                                                                        <object class="wxStaticBoxSizer">
                                                                                                                        <object class="sizeritem">
                                                                                                                                <option>1</option>
                                                                                                                                <flag>wxALL|wxEXPAND</flag>
                                                                                                                        <object class="sizeritem">
                                                                                                                                <option>1</option>
                                                                                                                                <flag>wxALL|wxEXPAND</flag>
-                                                                                                                               <border>5</border>
+                                                                                                                               <border>0</border>
                                                                                                                                <object class="wxGrid" name="GridSecondSkill" />
                                                                                                                        </object>
                                                                                                                </object>
                                                                                                                                <object class="wxGrid" name="GridSecondSkill" />
                                                                                                                        </object>
                                                                                                                </object>
                                                                                        </object>
                                                                                </object>
                                                                                <object class="sizeritem">
                                                                                        </object>
                                                                                </object>
                                                                                <object class="sizeritem">
-                                                                                       <option>1</option>
+                                                                                       <option>0</option>
                                                                                        <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
                                                                                        <border>10</border>
                                                                                        <object class="wxStaticBoxSizer">
                                                                                                <orient>wxVERTICAL</orient>
                                                                                                <label>対応第2スキル(いにしえの錬金)</label>
                                                                                        <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
                                                                                        <border>10</border>
                                                                                        <object class="wxStaticBoxSizer">
                                                                                                <orient>wxVERTICAL</orient>
                                                                                                <label>対応第2スキル(いにしえの錬金)</label>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>1</option>
+                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <object class="wxFlexGridSizer">
+                                                                                                               <rows>2</rows>
+                                                                                                               <cols>3</cols>
+                                                                                                               <vgap>0</vgap>
+                                                                                                               <hgap>0</hgap>
+                                                                                                               <growablecols>0,1,2</growablecols>
+                                                                                                               <growablerows></growablerows>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER|wxALL</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticText31">
+                                                                                                                               <label>スキル名</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER|wxALL</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticText32">
+                                                                                                                               <label>判定値1</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER|wxALL</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticText33">
+                                                                                                                               <label>判定値2</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxTextCtrl" name="TextCtrlInishieSkill">
+                                                                                                                               <value></value>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxTextCtrl" name="TextCtrlInishieThreshold1">
+                                                                                                                               <value></value>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxTextCtrl" name="TextCtrlInishieThreshold2">
+                                                                                                                               <value></value>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                       </object>
+                                                                                               </object>
                                                                                        </object>
                                                                                </object>
                                                                        </object>
                                                                                        </object>
                                                                                </object>
                                                                        </object>
                                                                                <object class="sizeritem">
                                                                                        <option>1</option>
                                                                                        <flag>wxEXPAND</flag>
                                                                                <object class="sizeritem">
                                                                                        <option>1</option>
                                                                                        <flag>wxEXPAND</flag>
-                                                                                       <border>0</border>
+                                                                                       <border>5</border>
                                                                                        <object class="wxListBox" name="ListBoxSeedSkillAmuletProspect">
                                                                                                <content />
                                                                                        </object>
                                                                                        <object class="wxListBox" name="ListBoxSeedSkillAmuletProspect">
                                                                                                <content />
                                                                                        </object>
                                </object>
                        </object>
                        <object class="notebookpage">
                                </object>
                        </object>
                        <object class="notebookpage">
+                               <label>Seed1の特定</label>
+                               <selected>1</selected>
+                               <object class="wxPanel" name="NoteBookPanelSeed1">
+                                       <style>wxTAB_TRAVERSAL</style>
+                                       <object class="wxBoxSizer">
+                                               <orient>wxHORIZONTAL</orient>
+                                               <object class="sizeritem">
+                                                       <option>2</option>
+                                                       <flag>wxEXPAND</flag>
+                                                       <border>5</border>
+                                                       <object class="wxBoxSizer">
+                                                               <orient>wxVERTICAL</orient>
+                                                               <object class="sizeritem">
+                                                                       <option>0</option>
+                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                       <border>5</border>
+                                                                       <object class="wxStaticBoxSizer">
+                                                                               <orient>wxVERTICAL</orient>
+                                                                               <label>錬金結果(天運)</label>
+                                                                               <object class="sizeritem">
+                                                                                       <option>0</option>
+                                                                                       <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
+                                                                                       <border>3</border>
+                                                                                       <object class="wxStaticBoxSizer">
+                                                                                               <orient>wxHORIZONTAL</orient>
+                                                                                               <label>使用したお守り</label>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALL</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <object class="wxRadioButton" name="RadioButtonRenkinUsage1">
+                                                                                                               <label>古びたお守り(女王/王/龍)3個</label>
+                                                                                                               <value>1</value>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALL</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <object class="wxRadioButton" name="RadioButtonRenkinUsage2">
+                                                                                                               <label>歪んだお守り(神秘/未知)3個</label>
+                                                                                                               <value>0</value>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="sizeritem">
+                                                                                       <option>0</option>
+                                                                                       <flag>wxEXPAND</flag>
+                                                                                       <border>3</border>
+                                                                                       <object class="wxBoxSizer">
+                                                                                               <orient>wxHORIZONTAL</orient>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALIGN_CENTER|wxALL</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <object class="wxStaticText" name="m_staticText34">
+                                                                                                               <style>wxALIGN_CENTRE</style>
+                                                                                                               <label>錬金で得たお守りの数</label>
+                                                                                                               <wrap>-1</wrap>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALL</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <object class="wxSpinCtrl" name="SpinCtrlSeed1AmuletNum">
+                                                                                                               <style>wxSP_ARROW_KEYS</style>
+                                                                                                               <value>3</value>
+                                                                                                               <min>3</min>
+                                                                                                               <max>7</max>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="sizeritem">
+                                                                                       <option>1</option>
+                                                                                       <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
+                                                                                       <border>3</border>
+                                                                                       <object class="wxStaticBoxSizer">
+                                                                                               <orient>wxVERTICAL</orient>
+                                                                                               <label>錬金結果の第1スキル</label>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>1</option>
+                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                       <border>0</border>
+                                                                                                       <object class="wxGridSizer">
+                                                                                                               <rows>3</rows>
+                                                                                                               <cols>7</cols>
+                                                                                                               <vgap>2</vgap>
+                                                                                                               <hgap>4</hgap>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_1">
+                                                                                                                               <label>1枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_2">
+                                                                                                                               <label>2枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_3">
+                                                                                                                               <label>3枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_4">
+                                                                                                                               <label>4枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_5">
+                                                                                                                               <label>5枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_6">
+                                                                                                                               <label>6枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxALIGN_CENTER</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxStaticText" name="m_staticTextSeed1_7">
+                                                                                                                               <label>7枠目</label>
+                                                                                                                               <wrap>-1</wrap>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>0</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet1">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>0</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet2">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet3">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet4">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet5">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet6">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>5</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Amulet7">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill1">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill2">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill3">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill4">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill5">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill6">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <object class="sizeritem">
+                                                                                                                       <option>0</option>
+                                                                                                                       <flag>wxEXPAND</flag>
+                                                                                                                       <border>3</border>
+                                                                                                                       <object class="wxComboBox" name="ComboBoxSeed1Skill7">
+                                                                                                                               <style>wxCB_READONLY</style>
+                                                                                                                               <enabled>0</enabled>
+                                                                                                                               <value>Combo!</value>
+                                                                                                                               <content />
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="sizeritem">
+                                                                                       <option>0</option>
+                                                                                       <flag>wxEXPAND</flag>
+                                                                                       <border>3</border>
+                                                                                       <object class="wxBoxSizer">
+                                                                                               <orient>wxHORIZONTAL</orient>
+                                                                                               <object class="spacer">
+                                                                                                       <option>1</option>
+                                                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                                                       <border>5</border>
+                                                                                                       <size>0,0</size>
+                                                                                               </object>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALL</flag>
+                                                                                                       <border>3</border>
+                                                                                                       <object class="wxButton" name="ButtonSeed1Search">
+                                                                                                               <label>検索</label>
+                                                                                                               <default>0</default>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <object class="sizeritem">
+                                                                                                       <option>0</option>
+                                                                                                       <flag>wxALL</flag>
+                                                                                                       <border>3</border>
+                                                                                                       <object class="wxButton" name="ButtonSeed1Clear">
+                                                                                                               <label>クリア</label>
+                                                                                                               <default>0</default>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                               </object>
+                                                                       </object>
+                                                               </object>
+                                                               <object class="sizeritem">
+                                                                       <option>1</option>
+                                                                       <flag>wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</flag>
+                                                                       <border>5</border>
+                                                                       <object class="wxStaticBoxSizer">
+                                                                               <orient>wxVERTICAL</orient>
+                                                                               <label>該当Seed1とその周辺値</label>
+                                                                               <object class="sizeritem">
+                                                                                       <option>1</option>
+                                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                                       <border>5</border>
+                                                                                       <object class="wxTextCtrl" name="TextCtrl1Seed1Result">
+                                                                                               <style>wxTE_MULTILINE|wxTE_READONLY</style>
+                                                                                               <value></value>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="sizeritem">
+                                                                                       <option>3</option>
+                                                                                       <flag>wxEXPAND | wxALL</flag>
+                                                                                       <border>5</border>
+                                                                                       <object class="wxPanel" name="m_panel13">
+                                                                                               <style>wxTAB_TRAVERSAL</style>
+                                                                                               <object class="wxBoxSizer">
+                                                                                                       <orient>wxVERTICAL</orient>
+                                                                                                       <object class="sizeritem">
+                                                                                                               <option>1</option>
+                                                                                                               <flag>wxALL|wxEXPAND</flag>
+                                                                                                               <border>0</border>
+                                                                                                               <object class="wxGrid" name="GridSeed1Table" />
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                       </object>
+                                                                               </object>
+                                                                       </object>
+                                                               </object>
+                                                       </object>
+                                               </object>
+                                               <object class="sizeritem">
+                                                       <option>1</option>
+                                                       <flag>wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP</flag>
+                                                       <border>5</border>
+                                                       <object class="wxStaticBoxSizer">
+                                                               <orient>wxVERTICAL</orient>
+                                                               <label>メモ入用。ご自由にお使いください</label>
+                                                               <object class="sizeritem">
+                                                                       <option>1</option>
+                                                                       <flag>wxALL|wxEXPAND</flag>
+                                                                       <border>5</border>
+                                                                       <object class="wxTextCtrl" name="m_textCtrl11">
+                                                                               <style>wxTE_MULTILINE</style>
+                                                                               <value></value>
+                                                                       </object>
+                                                               </object>
+                                                       </object>
+                                               </object>
+                                       </object>
+                               </object>
+                       </object>
+                       <object class="notebookpage">
                                <label>お守り検索</label>
                                <selected>0</selected>
                                <object class="wxPanel" name="NoteBookPanelAmuletSearch">
                                <label>お守り検索</label>
                                <selected>0</selected>
                                <object class="wxPanel" name="NoteBookPanelAmuletSearch">
index 6306087..56d250d 100644 (file)
@@ -1,12 +1,18 @@
 # -*- coding: utf-8 -*-
 
 # GUIのメインフレーム
 # -*- coding: utf-8 -*-
 
 # GUIのメインフレーム
-# 2013/12/05 written by kei9
+# 2013/12/15 written by kei9
 import wx
 from wx import xrc
 import wx.grid
 
 import constnumbers
 import wx
 from wx import xrc
 import wx.grid
 
 import constnumbers
+from notebookflowview import NoteBookFlowView
+from notebooksettingview import NoteBookSettingView
+from notebookseed1view import NoteBookSeed1View
+from notebookseed2view import NoteBookSeed2View
+from notebookskill2view import NoteBookSkill2View
+from notebookamuletview import NoteBookAmuletView
 
 class MainFrameView():
     u""" メインのフレームクラス """
 
 class MainFrameView():
     u""" メインのフレームクラス """
@@ -17,148 +23,29 @@ class MainFrameView():
     def _init_frame(self):
         # load controls
         self.frame = self.res.LoadFrame(None, "MainFrame")
     def _init_frame(self):
         # load controls
         self.frame = self.res.LoadFrame(None, "MainFrame")
-
         self.note_book = xrc.XRCCTRL(self.frame, "NoteBookMain")
 
         self.note_book = xrc.XRCCTRL(self.frame, "NoteBookMain")
 
-        # buttons
-        self.button_seed_seaerch = xrc.XRCCTRL(self.frame, "ButtonSeedSearch")
-        self.button_seed_clear = xrc.XRCCTRL(self.frame, "ButtonSeedClear")
-        self.button_skill_from_seed_search = xrc.XRCCTRL(self.frame, "ButtonSkillFromSeedSearch")
-        self.button_skill_search = xrc.XRCCTRL(self.frame, "ButtonSeedSkillSearch")
-        self.button_skill_clear = xrc.XRCCTRL(self.frame, "ButtonSeedSkillClear")
-        self.button_amulet_search_seaerch = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchSearch")
-        self.button_amulet_search_clear = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchClear")
-        self.button_amulet_search_skill = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchSkill")
-        self.button_setting_ok = xrc.XRCCTRL(self.frame, "ButtonSettingOK")
-        self.button_setting_clear = xrc.XRCCTRL(self.frame, "ButtonSettingClear")
-
-        self.ID_BUTTON_SEED_SEARCH = xrc.XRCID("ButtonSeedSearch")
-        self.ID_BUTTON_SEED_CLEAR = xrc.XRCID("ButtonSeedClear")
-        self.ID_BUTTON_SKILL_FROM_SEED_SEARCH = xrc.XRCID("ButtonSkillFromSeedSearch")
-        self.ID_BUTTON_SKILL_SEARCH = xrc.XRCID("ButtonSeedSkillSearch")
-        self.ID_BUTTON_SKILL_CLEAR = xrc.XRCID("ButtonSeedSkillClear")
-        self.ID_BUTTON_AMULET_SEARCH_SEARCH = xrc.XRCID("ButtonAmuletSearchSearch")
-        self.ID_BUTTON_AMULET_SEARCH_CLEAR = xrc.XRCID("ButtonAmuletSearchClear")
-        self.ID_BUTTON_AMULET_SEARCH_SKILL = xrc.XRCID("ButtonAmuletSearchSkill")
-        self.ID_BUTTON_SETTING_OK = xrc.XRCID("ButtonSettingOK")
-        self.ID_BUTTON_SETTING_CLEAR = xrc.XRCID("ButtonSettingClear")
-
-        # radio button
-        self.radio_button_amulet1 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet1")
-        self.radio_button_amulet2 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet2")
-        self.radio_button_amulet3 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet3")
-        self.ID_RADIO_BUTTON_AMULET1 = xrc.XRCID("RadioButtonAmulet1")
-        self.ID_RADIO_BUTTON_AMULET2 = xrc.XRCID("RadioButtonAmulet2")
-        self.ID_RADIO_BUTTON_AMULET3 = xrc.XRCID("RadioButtonAmulet3")
-        self.amulet2radio_button_dict = {}
-        self.amulet2radio_button_dict[constnumbers.NAME_AMULET1] = self.radio_button_amulet1
-        self.amulet2radio_button_dict[constnumbers.NAME_AMULET2] = self.radio_button_amulet2
-        self.amulet2radio_button_dict[constnumbers.NAME_AMULET3] = self.radio_button_amulet3
-        self.amulet2radio_id_dict = {}
-        self.amulet2radio_id_dict[constnumbers.NAME_AMULET1] = self.ID_RADIO_BUTTON_AMULET1
-        self.amulet2radio_id_dict[constnumbers.NAME_AMULET2] = self.ID_RADIO_BUTTON_AMULET2
-        self.amulet2radio_id_dict[constnumbers.NAME_AMULET3] = self.ID_RADIO_BUTTON_AMULET3
-
-        #load grid
-        self.skill2_grid = xrc.XRCCTRL(self.frame, "GridSecondSkill")
-        self.ID_SKILL2_GRID = xrc.XRCID("GridSecondSkill")
-        self._load_grid()
-        self.skill2_grid.Bind(wx.EVT_SIZE, self.OnGridSize)
-
         # menu
         self.ID_MENU_ITEM_EXIT = xrc.XRCID("wxID_EXIT") # same as wx.ID_EXIT
         self.ID_MENU_ITEM_ABOUT = xrc.XRCID("wxID_ABOUT") # same as wx.ID_ABOUT
 
         # menu
         self.ID_MENU_ITEM_EXIT = xrc.XRCID("wxID_EXIT") # same as wx.ID_EXIT
         self.ID_MENU_ITEM_ABOUT = xrc.XRCID("wxID_ABOUT") # same as wx.ID_ABOUT
 
-        # load text ctrls
-        self._load_text_ctrls()
-
-        # load combo box
-        self._load_combo_boxes()
-
-        # load list box
-        self.list_box_seed = xrc.XRCCTRL(self.frame, "ListBoxSeed")
-        self.list_box_amulet_search_seeds = xrc.XRCCTRL(self.frame, "ListBoxAmuletSearchSeeds")
-        self.list_box_seed_skill_amulet_prospect = xrc.XRCCTRL(self.frame, "ListBoxSeedSkillAmuletProspect")
-        self.ID_LIST_BOX_SEED = xrc.XRCID("ListBoxSeed")
-        self.ID_LIST_BOX_AMULET_SEARCH_SEEDS = xrc.XRCID("ListBoxAmuletSearchSeeds")
-        self.ID_LIST_BOX_SEED_SKILL_AMULET_PROSPECT = xrc.XRCID("ListBoxSeedSkillAmuletProspect")
-
-        # load spin ctrl
-        self.spin_ctrl_amulet_search_skill1_val = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSkill1Value")
-        self.spin_ctrl_amulet_search_skill2_val = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSkill2Value")
-        self.spin_ctrl_amulet_search_slot_num = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSlotNumber")
-        self.ID_SPIN_CTRL_AMULET_SKILL1_VAL = xrc.XRCID("SpinCtrlAmuletSearchSkill1Value")
-        self.ID_SPIN_CTRL_AMULET_SKILL2_VAL = xrc.XRCID("SpinCtrlAmuletSearchSkill2Value")
-        self.spin_ctrl_highlight1 = xrc.XRCCTRL(self.frame, "SpinCtrlHighlightThreshold1")
-        self.spin_ctrl_highlight2 = xrc.XRCCTRL(self.frame, "SpinCtrlHighlightThreshold2")
-
-        # load custom ctrl
-        self.ID_CHECK_LIST_BOX_HIGHLIGHT_SKILL = xrc.XRCID("CheckListBoxHighlight")
-        self.check_list_box_highlight_skill =  xrc.XRCCTRL(self.frame, "CheckListBoxHighlight")
-
-        # set explanation text
-        self.text_ctrl_seed_explain.SetValue(constnumbers.SEED_DECISION_EXPLANATION)
-        self.text_ctrl_flow.SetValue(constnumbers.SECOND_SKILL_FLOW)
-
-    def _load_combo_boxes(self):
-        # load combo boxes
-        self.combo_box_skill_dict = {}
-        self.combo_box_skill_dict[constnumbers.KEY_AMULET1] = [
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_1"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_2"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_3"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_4"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_5"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_6"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_7")]
-        self.combo_box_skill_dict[constnumbers.KEY_AMULET2] = [
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_1"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_2"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_3"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_4"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_5"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_6"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_7")]
-        self.combo_box_skill_dict[constnumbers.KEY_AMULET3] = [
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_1"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_2"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_3"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_4"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_5"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_6"),
-                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_7")]
-        self.combo_box_amulet_search_skill1 = xrc.XRCCTRL(self.frame, "ComboBoxAmuletSearchSkill1")
-        self.combo_box_amulet_search_skill2 = xrc.XRCCTRL(self.frame, "ComboBoxAmuletSearchSkill2")
-        self.ID_COMBO_BOX_AMULET_SEARCH_SKILL1 = xrc.XRCID("ComboBoxAmuletSearchSkill1")
-        self.ID_COMBO_BOX_AMULET_SEARCH_SKILL2 = xrc.XRCID("ComboBoxAmuletSearchSkill2")
-
-    def _load_text_ctrls(self):
-        # load text ctrls
-        self.text_ctrl_seed_explain = xrc.XRCCTRL(self.frame, "TextCtrlSeedExplain")
-        self.text_ctrl_seed_result = xrc.XRCCTRL(self.frame, "TextCtrlSeedResults")
-        self.text_ctrl_seed_select = xrc.XRCCTRL(self.frame, "TextCtrlSeedSelect")
-        self.text_ctrl_amulet_search_result = xrc.XRCCTRL(self.frame, "TextCtrlAmuletSearchResult")
-        self.text_ctrl_flow = xrc.XRCCTRL(self.frame, "TextCtrlFlow")
-
-    def _load_grid(self):
-        # load grid value
-        self.skill2_grid.CreateGrid(constnumbers.NUM_SKILL2_GRID_ROW, constnumbers.NUM_SKILL2_GRID_COL)
-        self.skill2_grid.SetColLabelValue(0, constnumbers.NAME_AMULET1)
-        self.skill2_grid.SetColLabelValue(1, constnumbers.NAME_AMULET2)
-        self.skill2_grid.SetColLabelValue(2, constnumbers.NAME_AMULET3)
-        self.skill2_grid.SetColLabelValue(3, constnumbers.NAME_THRESHOLD1)
-        self.skill2_grid.SetColLabelValue(4, constnumbers.NAME_THRESHOLD2)
-        for i in range(constnumbers.NUM_SKILL2_GRID_ROW):
-            self.skill2_grid.SetRowLabelValue(i, constnumbers.LABEL_FORMAT_SKILL2_GRID_ROW.format(i))
-        self.skill2_grid.DisableDragGridSize()
-        self.skill2_grid.EnableEditing(False)
-
-    def OnGridSize(self, event):
-        width, height = self.skill2_grid.GetParent().GetSize()
-        each_width = (width - 50) / (constnumbers.NUM_SKILL2_GRID_COL) # consider margin size
-        self.skill2_grid.SetRowLabelSize(40)
-        for col in range(constnumbers.NUM_SKILL2_GRID_COL):
-            self.skill2_grid.SetColSize(col, each_width) 
+        # seed1 decision view
+        self.notebook_seed1_view = NoteBookSeed1View(self.frame)
+
+        # seed2 decision view
+        self.notebook_seed2_view = NoteBookSeed2View(self.frame)
+
+        # skill2 search from seed2 view
+        self.notebook_skill2_view = NoteBookSkill2View(self.frame)
+
+        # amulet view
+        self.notebook_amulet_view = NoteBookAmuletView(self.frame)
+
+        # flow view
+        self.notebook_flow_view = NoteBookFlowView(self.frame)
+
+        # setting view
+        self.notebook_setting_view = NoteBookSettingView(self.frame)
 
     def Show(self):
         self.frame.Show()
 
     def Show(self):
         self.frame.Show()
@@ -171,7 +58,7 @@ class MainFrameView():
 
     def EnableNoteBook(self):
         self.note_book.Enable()
 
     def EnableNoteBook(self):
         self.note_book.Enable()
-        
+
     def OnAboutBox(self, evt):
         u""" Show About Box """
         info = wx.AboutDialogInfo()
     def OnAboutBox(self, evt):
         u""" Show About Box """
         info = wx.AboutDialogInfo()
diff --git a/view/notebookamuletview.py b/view/notebookamuletview.py
new file mode 100644 (file)
index 0000000..1af4dd3
--- /dev/null
@@ -0,0 +1,204 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおけるお守り検索Notebookのview
+# 2013/12/15 written by kei9
+import wx
+from wx import xrc
+import wx.grid
+
+import constnumbers
+
+class NoteBookAmuletView():
+    u""" メインのフレームのお守り検索タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+
+    def _init_view(self):
+        # initialize view
+
+        # button
+        self.button_search = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchSearch")
+        self.button_clear = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchClear")
+        self.button_skill = xrc.XRCCTRL(self.frame, "ButtonAmuletSearchSkill")
+        self.ID_BUTTON_SEARCH = xrc.XRCID("ButtonAmuletSearchSearch")
+        self.ID_BUTTON_CLEAR = xrc.XRCID("ButtonAmuletSearchClear")
+        self.ID_BUTTON_SKILL = xrc.XRCID("ButtonAmuletSearchSkill")
+
+        # radio button
+        self.radio_button_amulet1 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet1")
+        self.radio_button_amulet2 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet2")
+        self.radio_button_amulet3 = xrc.XRCCTRL(self.frame, "RadioButtonAmulet3")
+        self.ID_RADIO_BUTTON_AMULET1 = xrc.XRCID("RadioButtonAmulet1")
+        self.ID_RADIO_BUTTON_AMULET2 = xrc.XRCID("RadioButtonAmulet2")
+        self.ID_RADIO_BUTTON_AMULET3 = xrc.XRCID("RadioButtonAmulet3")
+        self.amulet2radio_button_dict = {}
+        self.amulet2radio_button_dict[constnumbers.NAME_AMULET1] = self.radio_button_amulet1
+        self.amulet2radio_button_dict[constnumbers.NAME_AMULET2] = self.radio_button_amulet2
+        self.amulet2radio_button_dict[constnumbers.NAME_AMULET3] = self.radio_button_amulet3
+        self.amulet2radio_id_dict = {}
+        self.amulet2radio_id_dict[constnumbers.NAME_AMULET1] = self.ID_RADIO_BUTTON_AMULET1
+        self.amulet2radio_id_dict[constnumbers.NAME_AMULET2] = self.ID_RADIO_BUTTON_AMULET2
+        self.amulet2radio_id_dict[constnumbers.NAME_AMULET3] = self.ID_RADIO_BUTTON_AMULET3
+
+        # seed list
+        self.list_box_seeds = xrc.XRCCTRL(self.frame, "ListBoxAmuletSearchSeeds")
+        self.ID_LIST_BOX_SEEDS = xrc.XRCID("ListBoxAmuletSearchSeeds")
+
+        # spin ctrl
+        self.spin_ctrl_skill1_val = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSkill1Value")
+        self.spin_ctrl_skill2_val = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSkill2Value")
+        self.spin_ctrl_slot_num = xrc.XRCCTRL(self.frame, "SpinCtrlAmuletSearchSlotNumber")
+        self.ID_SPIN_CTRL_SKILL1_VAL = xrc.XRCID("SpinCtrlAmuletSearchSkill1Value")
+        self.ID_SPIN_CTRL_SKILL2_VAL = xrc.XRCID("SpinCtrlAmuletSearchSkill2Value")
+
+        # combobox
+        self.combo_box_skill1 = xrc.XRCCTRL(self.frame, "ComboBoxAmuletSearchSkill1")
+        self.combo_box_skill2 = xrc.XRCCTRL(self.frame, "ComboBoxAmuletSearchSkill2")
+        self.ID_COMBO_BOX_SKILL1 = xrc.XRCID("ComboBoxAmuletSearchSkill1")
+        self.ID_COMBO_BOX_SKILL2 = xrc.XRCID("ComboBoxAmuletSearchSkill2")
+
+        # text ctrl
+        self.text_ctrl_result = xrc.XRCCTRL(self.frame, "TextCtrlAmuletSearchResult")
+
+        # set min & max of slot
+        self.set_slot_minmax(constnumbers.SLOT_MIN, constnumbers.SLOT_MAX)
+
+    def bind_radio_button(self, event_func, evt=wx.EVT_RADIOBUTTON):
+        u""" ラジオボタンが押された時のイベントをセットする """
+        self.radio_button_amulet1.Bind(evt, event_func)
+        self.radio_button_amulet2.Bind(evt, event_func)
+        self.radio_button_amulet3.Bind(evt, event_func)
+
+    def bind_combobox(self, event_func, evt=wx.EVT_COMBOBOX):
+        u""" コンボボタンが押された時のイベントをセットする """
+        self.combo_box_skill1.Bind(evt, event_func)
+        self.combo_box_skill2.Bind(evt, event_func)
+
+    def bind_button_search(self, event_func, evt=wx.EVT_BUTTON):
+        u""" 検索ボタンが押された時のイベントをセットする """
+        self.button_search.Bind(evt, event_func)
+
+    def bind_button_clear(self, event_func, evt=wx.EVT_BUTTON):
+        u""" クリアボタンが押された時のイベントをセットする """
+        self.button_clear.Bind(evt, event_func)
+
+    def bind_button_skill(self, event_func, evt=wx.EVT_BUTTON):
+        u""" スキル検索ボタンが押された時のイベントをセットする """
+        self.button_skill.Bind(evt, event_func)
+
+    def set_skill_minmax(self, min1, max1, min2, max2):
+        u""" 第1,2スキルの最大値と最小値をセットする """
+        self.spin_ctrl_skill1_val.SetRange(min1, max1)
+        self.spin_ctrl_skill2_val.SetRange(min2, max2)
+
+    def set_slot_minmax(self, slot_min, slot_max):
+        u""" スロットの最大値と最小値をセットする """
+        self.spin_ctrl_slot_num.SetRange(slot_min, slot_max)
+
+    def get_skill_values(self):
+        u""" 第1,2スキルの値を得る 
+        return (skill1_val, skill2_val)"""
+        skill1_val = self.spin_ctrl_skill1_val.GetValue()
+        skill2_val = self.spin_ctrl_skill2_val.GetValue()
+        return (skill1_val, skill2_val)
+
+    def get_slot_value(self):
+        u""" スロットの値を得る """
+        return self.spin_ctrl_slot_num.GetValue()
+
+    def set_radio_value(self, value, amulet_name=constnumbers.NAME_AMULET1):
+        u""" ラジオボタンの値をセットする 
+            arg: (value, amulet_name)
+        """
+        self.amulet2radio_button_dict[amulet_name].SetValue(value)
+
+    def get_radio_value(self, amulet_name=constnumbers.NAME_AMULET1):
+        u""" ラジオボタンの値を得る
+            return: (value)
+        """
+        return self.amulet2radio_button_dict[amulet_name].GetValue()
+
+    def get_selected_radio_name(self):
+        u""" 選択されているラジオボタンのお守り名を得る 
+            return: (NAME_OF_AMULET)
+        """
+        if self.amulet2radio_button_dict[constnumbers.NAME_AMULET1].GetValue:
+            return constnumbers.NAME_AMULET1
+        elif self.amulet2radio_button_dict[constnumbers.NAME_AMULET2].GetValue:
+            return constnumbers.NAME_AMULET2
+        elif self.amulet2radio_button_dict[constnumbers.NAME_AMULET3].GetValue:
+            return constnumbers.NAME_AMULET3
+        else:
+            raise NotImplementedError("irregular radio button selected")
+
+    def set_selection_skill1_combobox(self, idx):
+        u""" skill1のコンボボックスの選択されたインデックスをセットする """
+        self.combo_box_skill1.SetSelection(idx)
+
+    def set_selection_skill2_combobox(self, idx):
+        u""" skill2のコンボボックスの選択されたインデックスをセットする """
+        self.combo_box_skill2.SetSelection(idx)
+
+    def get_string_selection_skill1_combobox(self):
+        u""" skill1のコンボボックスの選択された値を得る """
+        return self.combo_box_skill1.GetStringSelection()
+
+    def get_string_selection_skill2_combobox(self):
+        u""" skill2のコンボボックスの選択された値を得る """
+        return self.combo_box_skill2.GetStringSelection()
+
+    def get_string_selection_skill_names(self):
+        u""" skill1, skill2で選択されているスキル名を返す
+            return (skill1_name, skill2_name)"""
+        skill1_name = self.get_string_selection_skill1_combobox()
+        skill2_name = self.get_string_selection_skill2_combobox()
+        return (skill1_name, skill2_name)
+
+    def set_items_skill1_combobox(self, string_list):
+        u""" skill1のコンボボックスの値をセットする """
+        self.combo_box_skill1.SetItems(string_list)
+
+    def set_items_skill2_combobox(self, string_list):
+        u""" skill2のコンボボックスの値をセットする """
+        self.combo_box_skill2.SetItems(string_list)
+
+    def set_items_skill_combobox(self, idx, string_list):
+        u""" 指定されたインデックスのskillのコンボボックスの値をセットする """
+        if idx == 0:
+            self.set_items_skill1_combobox(string_list)
+        elif idx == 1:
+            self.set_items_skill2_combobox(string_list)
+        else:
+            raise NotImplementedError(u"this idx is not implemented")
+
+    def set_skill_button_enable(self, value):
+        u""" 対応スキル検索ボタンの有効・無効の切り替え """
+        if value is True:
+            self.button_skill.Enable()
+        else:
+            self.button_skill.Disable()
+
+    def set_result_text_ctrl_value(self, value):
+        u""" 結果表示用のTextCtrlに値をセットする """
+        self.text_ctrl_result.SetValue(value)
+
+    def set_listbox_items(self, items):
+        u""" Seed一覧のListBoxに値をセットする。
+        Noneが与えられた時はClearする"""
+        if items is not None:
+            self.list_box_seeds.SetItems(items)
+        else:
+            self.list_box_seeds.Clear()
+
+    def get_string_selection_listbox(self):
+        u""" Seed一覧のListBoxの選択された値を得る。"""
+        return self.list_box_seeds.GetStringSelection()
+
+    def set_selection_listbox(self, idx):
+        u""" Seed一覧のListBoxの選択されたインデックスをセットする。"""
+        self.list_box_seeds.SetSelection(idx)
+
+    def clear_listbox_items(self):
+        u""" Seed一覧のListBoxから値をClearする"""
+        self.list_box_seeds.Clear()
diff --git a/view/notebookflowview.py b/view/notebookflowview.py
new file mode 100644 (file)
index 0000000..6c9576c
--- /dev/null
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおける流れ説明Notebookのview
+# 2013/12/15 written by kei9
+
+import wx
+from wx import xrc
+
+import constnumbers
+
+class NoteBookFlowView():
+    u""" メインフレームの流れ説明タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+
+    def _init_view(self):
+        # initialize view
+        self.text_ctrl_flow = xrc.XRCCTRL(self.frame, "TextCtrlFlow")
+        self.text_ctrl_flow.SetValue(constnumbers.SECOND_SKILL_FLOW)
+
+    def set_flow_value(self, value):
+        self.text_ctrl_flow.SetValue(value)
+
+    def clear_flow_value(self):
+        self.text_ctrl_flow.SetValue(u"")
diff --git a/view/notebookseed1view.py b/view/notebookseed1view.py
new file mode 100644 (file)
index 0000000..dc6213f
--- /dev/null
@@ -0,0 +1,96 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおけるSeed1特定Notebookのview
+# 2013/12/15 written by kei9
+import wx
+from wx import xrc
+import wx.grid
+
+import constnumbers
+
+class NoteBookSeed1View():
+    u""" メインのフレームのSeed1特定タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+        self._init_event()
+
+    def _init_view(self):
+        # initialize view
+
+        # buttons
+        self.radio_button_usage1 = xrc.XRCCTRL(self.frame, "RadioButtonRenkinUsage1")
+        self.radio_button_usage2 = xrc.XRCCTRL(self.frame, "RadioButtonRenkinUsage2")
+        self.button_search = xrc.XRCCTRL(self.frame, "ButtonSeed1Search")
+        self.button_clear = xrc.XRCCTRL(self.frame, "ButtonSeed1Clear")
+
+        self.spin_ctrl_amulet_num = xrc.XRCCTRL(self.frame, "SpinCtrlSeed1AmuletNum")
+
+        # load combo boxes
+        self.combobox_amulet_list = [xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet1"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet2"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet3"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet4"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet5"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet6"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Amulet7")]
+        self.combobox_skill_list = [xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill1"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill2"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill3"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill4"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill5"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill6"),
+                xrc.XRCCTRL(self.frame, "ComboBoxSeed1Skill7")]
+
+        # text ctrl
+        self.text_ctrl_result = xrc.XRCCTRL(self.frame, "TextCtrl1Seed1Result")
+
+        # grid
+        self.grid_seed1 = xrc.XRCCTRL(self.frame, "GridSeed1Table")
+        u"""Tableを結果TextCtrlで示し、No.をrowラベル、行には天運個数、
+        1-7枠目の値を表示する。1-7枠目をお守りの種類とスキル名で分けると面倒なので
+        合体させて1つの行で表示した方がいいかもしれない。この場合は行数は8となる"""
+        self.grid_seed1.CreateGrid(constnumbers.NUM_SEED1_GRID_ROW, constnumbers.NUM_SEED1_GRID_COL)
+        self.grid_seed1.SetColLabelValue(0, constnumbers.LABEL_FORMAT_SEED1_GRID_COL1)
+        for i in range(1, constnumbers.NUM_SEED1_GRID_COL):
+            self.grid_seed1.SetColLabelValue(i, 
+                    constnumbers.LABEL_FORMAT_SEED1_GRID_COL_AFTER1.format(i))
+        self.grid_seed1.DisableDragGridSize()
+        self.grid_seed1.EnableEditing(False)
+
+    def _init_event(self):
+        u""" イベントの登録 """
+        self.spin_ctrl_amulet_num.Bind(wx.EVT_SPINCTRL, self.OnSpinCtrlChanged)
+        self.grid_seed1.Bind(wx.EVT_SIZE, self.OnGridSizeChanged)
+
+    def OnSpinCtrlChanged(self, event):
+        u""" SpinCtrlの値が変わった時のイベント。
+        設定できるコンボボックスの数を調節する """
+        val = self.spin_ctrl_amulet_num.GetValue()
+        for combo1, combo2 in zip(self.combobox_amulet_list[:val], self.combobox_skill_list[:val]):
+            combo1.Enable()
+            combo2.Enable()
+        for combo1, combo2 in zip(self.combobox_amulet_list[val:], self.combobox_skill_list[val:]):
+            combo1.Disable()
+            combo2.Disable()
+
+    def OnGridSizeChanged(self, event):
+        u""" Gridサイズの変更時 """
+        width, height = self.grid_seed1.GetParent().GetSize()
+        each_width = (width - 55) / (constnumbers.NUM_SEED1_GRID_COL) # consider margin size
+        self.grid_seed1.SetRowLabelSize(45)
+        for col in range(constnumbers.NUM_SEED1_GRID_COL):
+            self.grid_seed1.SetColSize(col, each_width) 
+
+    def bind_button_search(self, event_func, evt=wx.EVT_BUTTON):
+        u""" 検索ボタンへのイベント登録 """
+        self.button_search.Bind(evt, event_func)
+
+    def bind_button_clear(self, event_func, evt=wx.EVT_BUTTON):
+        u""" クリアボタンへのイベント登録 """
+        self.button_clear.Bind(evt, event_func)
+
+    def bind_radio_button(self, event_func, evt=wx.EVT_RADIOBUTTON):
+        u""" ラジオボタンが押された時のイベントをセットする """
+        self.radio_button_usage1.Bind(evt, event_func)
+        self.radio_button_usage2.Bind(evt, event_func)
diff --git a/view/notebookseed2view.py b/view/notebookseed2view.py
new file mode 100644 (file)
index 0000000..e6cc3dc
--- /dev/null
@@ -0,0 +1,121 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおけるSeed2特定Notebookのview
+# 2013/12/15 written by kei9
+import wx
+from wx import xrc
+import wx.grid
+
+import constnumbers
+
+class NoteBookSeed2View():
+    u""" メインのフレームのSeed2特定タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+
+    def _init_view(self):
+        # initialize view
+
+        # buttons
+        self.button_search = xrc.XRCCTRL(self.frame, "ButtonSeedSearch")
+        self.button_clear = xrc.XRCCTRL(self.frame, "ButtonSeedClear")
+        self.button_skill2 = xrc.XRCCTRL(self.frame, "ButtonSkillFromSeedSearch")
+
+        self.ID_BUTTON_SEARCH = xrc.XRCID("ButtonSeedSearch")
+        self.ID_BUTTON_CLEAR = xrc.XRCID("ButtonSeedClear")
+        self.ID_BUTTON_SKILL2 = xrc.XRCID("ButtonSkillFromSeedSearch")
+
+        # text ctrl
+        self.text_ctrl_seed2_explain = xrc.XRCCTRL(self.frame, "TextCtrlSeed2Explain")
+        self.text_ctrl_seed2_result = xrc.XRCCTRL(self.frame, "TextCtrlSeedResults")
+
+        # load combo boxes
+        self.combo_box_skill_dict = {}
+        self.combo_box_skill_dict[constnumbers.KEY_AMULET1] = [
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_1"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_2"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_3"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_4"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_5"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_6"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet1_7")]
+        self.combo_box_skill_dict[constnumbers.KEY_AMULET2] = [
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_1"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_2"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_3"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_4"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_5"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_6"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet2_7")]
+        self.combo_box_skill_dict[constnumbers.KEY_AMULET3] = [
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_1"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_2"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_3"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_4"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_5"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_6"),
+                xrc.XRCCTRL(self.frame, "ComboBoxAmulet3_7")]
+
+        # load list box
+        self.list_box_seed = xrc.XRCCTRL(self.frame, "ListBoxSeed")
+        self.ID_LIST_BOX_SEED = xrc.XRCID("ListBoxSeed")
+
+        # set explanation text
+        self.text_ctrl_seed2_explain.SetValue(constnumbers.SEED_DECISION_EXPLANATION)
+
+    def bind_button_search(self, event_func, evt=wx.EVT_BUTTON):
+        u""" 検索ボタンへのイベント登録 """
+        self.button_search.Bind(evt, event_func)
+
+    def bind_button_clear(self, event_func, evt=wx.EVT_BUTTON):
+        u""" クリアボタンへのイベント登録 """
+        self.button_clear.Bind(evt, event_func)
+
+    def bind_button_skill2(self, event_func, evt=wx.EVT_BUTTON):
+        u""" 対応スキル2ボタンへのイベント登録 """
+        self.button_skill2.Bind(evt, event_func)
+
+    def set_skill_names(self, amulet_key, skill_names):
+        u""" キーに対応するComboboxにスキル名をセットする。"""
+        for combo in self.combo_box_skill_dict[amulet_key]:
+            combo.SetItems(skill_names)
+            combo.SetSelection(0)
+
+    def get_selected_skill_names(self, amulet_key):
+        u""" キーに対応するComboboxで選択されているスキル名を返す"""
+        return [combo.GetStringSelection() for combo in self.combo_box_skill_dict[amulet_key]]
+
+    def set_skill_selected_idx(self, idx=0):
+        u""" Comboboxの選択されたインデックスを全て指定された値とする """
+        for key, combo_list in self.combo_box_skill_dict.items():
+            for combo in combo_list:
+                combo.SetSelection(idx)
+
+    def set_seed_lists(self, seed_list):
+        u""" Seed2一覧をセットする """
+        self.list_box_seed.SetItems(seed_list)
+        self.list_box_seed.SetSelection(0)
+
+    def clear_seed_list(self):
+        u""" Seed2一覧をクリアする """
+        self.list_box_seed.Clear()
+
+    def set_result_text(self, value):
+        u""" 検索結果を示すTextCtrlへの値のセット """
+        self.text_ctrl_seed2_result.SetValue(value)
+
+    def set_skill2_button_enable(self, value):
+        u""" 対応スキル検索ボタンの有効・無効の切り替え """
+        if value is True:
+            self.button_skill2.Enable()
+        else:
+            self.button_skill2.Disable()
+
+    def get_selected_seed2(self):
+        u""" ListBoxから選択したSeed2を返す。値が不正な場合はNoneを返す """
+        seed = self.list_box_seed.GetStringSelection()
+        if seed.isdigit():
+            return int(seed)
+        else:
+            return None
diff --git a/view/notebooksettingview.py b/view/notebooksettingview.py
new file mode 100644 (file)
index 0000000..49da371
--- /dev/null
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおける設定Notebookのview
+# 2013/12/15 written by kei9
+
+import wx
+from wx import xrc
+
+import constnumbers
+
+class NoteBookSettingView():
+    u""" メインフレームの流れ説明タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+
+    def _init_view(self):
+        # initialize view
+        self.spin_ctrl_highlight1 = xrc.XRCCTRL(self.frame, "SpinCtrlHighlightThreshold1")
+        self.spin_ctrl_highlight2 = xrc.XRCCTRL(self.frame, "SpinCtrlHighlightThreshold2")
+        self.check_list_box_highlight_skill =  xrc.XRCCTRL(self.frame, "CheckListBoxHighlight")
+        self.ID_CHECK_LIST_BOX_HIGHLIGHT_SKILL = xrc.XRCID("CheckListBoxHighlight")
+
+        self.button_ok = xrc.XRCCTRL(self.frame, "ButtonSettingOK")
+        self.button_clear = xrc.XRCCTRL(self.frame, "ButtonSettingClear")
+        self.ID_BUTTON_OK = xrc.XRCID("ButtonSettingOK")
+        self.ID_BUTTON_CLEAR = xrc.XRCID("ButtonSettingClear")
+
+        # set min & max
+        self.set_minmax(constnumbers.THRESHOLD1_MIN, constnumbers.THRESHOLD1_MAX,
+                constnumbers.THRESHOLD2_MIN, constnumbers.THRESHOLD2_MAX)
+        self.set_threshold(constnumbers.HIGHLIGHT_THRESHOLD1, constnumbers.HIGHLIGHT_THRESHOLD2)
+
+    def set_minmax(self, threshold1_min, threshold1_max, threshold2_min, threshold2_max):
+        u"""ハイライトする判定値のSpinCtrlの最大、最小値をセットする
+            arg: (threshold1_min, threshold1_max, threshold2_min, threshold2_max)
+        """
+        self.spin_ctrl_highlight1.SetRange(threshold1_min, threshold1_max)
+        self.spin_ctrl_highlight2.SetRange(threshold2_min, threshold2_max)
+
+    def set_threshold(self, threshold1, threshold2):
+        u"""ハイライトする判定値のSpinCtrlの値をセットする
+            arg (threshold1, threshold2)
+        """
+        self.spin_ctrl_highlight1.SetValue(threshold1)
+        self.spin_ctrl_highlight2.SetValue(threshold2)
+
+    def get_threshold(self):
+        u"""ハイライトする判定値のSpinCtrlの値を得る
+            return (threshold1, threshold2)
+        """
+        threshold1 = self.spin_ctrl_highlight1.GetValue()
+        threshold2 = self.spin_ctrl_highlight2.GetValue()
+        return (threshold1, threshold2)
+
+    def get_minmax(self):
+        u"""ハイライトする判定値のSpinCtrlの最大、最小値を得る
+            return (threshold1_min, threshold1_max, threshold2_min, threshold2_max)
+        """
+        threshold1_min = self.spin_ctrl_highlight1.GetMin()
+        threshold1_max = self.spin_ctrl_highlight1.GetMax()
+        threshold2_min = self.spin_ctrl_highlight2.GetMin()
+        threshold2_max = self.spin_ctrl_highlight2.GetMax()
+        return (threshold1_min, threshold1_max, threshold2_min, threshold2_max)
+
+    def set_skill_strings(self, string_list):
+        u""" CheckBoxListにスキル名をセットする """
+        self.check_list_box_highlight_skill.SetItems(string_list)
+
+    def get_checked_strings(self):
+        u""" CheckBoxListでチェックの入った文字列のリストを返す """
+        return [x for x in self.check_list_box_highlight_skill.GetCheckedStrings()]
+
+    def set_checked_strings(self, string_list):
+        u""" CheckBoxListで与えられた文字列に一致する名称のスキルにチェックを入れる """
+        self.check_list_box_highlight_skill.SetCheckedStrings(string_list)
+
+    def clear_checked_strings(self):
+        u""" CheckBoxListのチェックを全て外す """
+        for idx in self.check_list_box_highlight_skill.GetChecked():
+            self.check_list_box_highlight_skill.Check(idx, False)
+
+    def bind_button_ok(self, event_func, evt=wx.EVT_BUTTON):
+        u""" OKボタンが押された時のイベントをセットする """
+        self.button_ok.Bind(evt, event_func)
+
+    def bind_button_clear(self, event_func, evt=wx.EVT_BUTTON):
+        u""" クリアボタンが押された時のイベントをセットする """
+        self.button_clear.Bind(evt, event_func)
diff --git a/view/notebookskill2view.py b/view/notebookskill2view.py
new file mode 100644 (file)
index 0000000..2c587eb
--- /dev/null
@@ -0,0 +1,157 @@
+# -*- coding: utf-8 -*-
+
+# GUIのメインフレームにおけるSkill2一覧Notebookのview
+# 2013/12/15 written by kei9
+import wx
+from wx import xrc
+import wx.grid
+
+import constnumbers
+
+class NoteBookSkill2View():
+    u""" メインのフレームのスキル2一覧タブ """
+    def __init__(self, frame):
+        self.frame = frame
+        self._init_view()
+
+    def _init_view(self):
+        # initialize view
+        self.skill2_grid = xrc.XRCCTRL(self.frame, "GridSecondSkill")
+        self.ID_SKILL2_GRID = xrc.XRCID("GridSecondSkill")
+        self.skill2_grid.Bind(wx.EVT_SIZE, self.OnSkill2GridSize)
+
+        self.button_skill2_search = xrc.XRCCTRL(self.frame, "ButtonSeedSkillSearch")
+        self.button_skill2_clear = xrc.XRCCTRL(self.frame, "ButtonSeedSkillClear")
+        self.ID_BUTTON_SKILL2_SEARCH = xrc.XRCID("ButtonSeedSkillSearch")
+        self.ID_BUTTON_SKILL2_CLEAR = xrc.XRCID("ButtonSeedSkillClear")
+
+        # load skill2 grid value
+        self.skill2_grid.CreateGrid(constnumbers.NUM_SKILL2_GRID_ROW, constnumbers.NUM_SKILL2_GRID_COL)
+        self.skill2_grid.SetColLabelValue(0, constnumbers.NAME_AMULET1)
+        self.skill2_grid.SetColLabelValue(1, constnumbers.NAME_AMULET2)
+        self.skill2_grid.SetColLabelValue(2, constnumbers.NAME_AMULET3)
+        self.skill2_grid.SetColLabelValue(3, constnumbers.NAME_THRESHOLD1)
+        self.skill2_grid.SetColLabelValue(4, constnumbers.NAME_THRESHOLD2)
+        for i in range(constnumbers.NUM_SKILL2_GRID_ROW):
+            self.skill2_grid.SetRowLabelValue(i, constnumbers.LABEL_FORMAT_SKILL2_GRID_ROW.format(i))
+        self.skill2_grid.DisableDragGridSize()
+        self.skill2_grid.EnableEditing(False)
+
+        # text ctrl
+        self.text_ctrl_seed2_select = xrc.XRCCTRL(self.frame, "TextCtrlSeedSelect")
+        self.text_ctrl_inishie_skill2 = xrc.XRCCTRL(self.frame, "TextCtrlInishieSkill")
+        self.text_ctrl_inishie_threshold1 = xrc.XRCCTRL(self.frame, "TextCtrlInishieThreshold1")
+        self.text_ctrl_inishie_threshold2 = xrc.XRCCTRL(self.frame, "TextCtrlInishieThreshold2")
+
+        self.list_box_amulet_prospect = xrc.XRCCTRL(self.frame, "ListBoxSeedSkillAmuletProspect")
+        self.ID_LIST_BOX_AMULET_PROSPECT = xrc.XRCID("ListBoxSeedSkillAmuletProspect")
+
+    def OnSkill2GridSize(self, event):
+        u""" Gridリサイズ時に親パネルのwidthに応じて自動で横に伸長する """
+        width, height = self.skill2_grid.GetParent().GetSize()
+        each_width = (width - 50) / (constnumbers.NUM_SKILL2_GRID_COL) # consider margin size
+        self.skill2_grid.SetRowLabelSize(40)
+        for col in range(constnumbers.NUM_SKILL2_GRID_COL):
+            self.skill2_grid.SetColSize(col, each_width)
+
+    def bind_button_search(self, event_func, evt=wx.EVT_BUTTON):
+        u""" 検索ボタンへのイベント登録 """
+        self.button_skill2_search.Bind(evt, event_func)
+
+    def bind_button_clear(self, event_func, evt=wx.EVT_BUTTON):
+        u""" クリアボタンへのイベント登録 """
+        self.button_skill2_clear.Bind(evt, event_func)
+
+    def set_skill2_highlight(self, skill_names, threshold1, threshold2, color="Yellow"):
+        u""" スキル名、判定値1,2での条件を満たすセルをハイライトする """
+        skill_cols = [constnumbers.DICT_SKILL2_GRID_COL[x]
+                for x in [constnumbers.KEY_AMULET1, constnumbers.KEY_AMULET2, constnumbers.KEY_AMULET3]]
+        for row in range(constnumbers.NUM_SKILL2_GRID_ROW):
+            for col in skill_cols:
+                val = self.skill2_grid.GetCellValue(row, col)
+                if val in skill_names:
+                    self.skill2_grid.SetCellBackgroundColour(row, col, color)
+                else:
+                    self.skill2_grid.SetCellBackgroundColour(row, col, wx.NullColor)
+
+        # threshold
+        th_cols = [constnumbers.DICT_SKILL2_GRID_COL[x]
+                for x in [constnumbers.KEY_THRESHOLD1, constnumbers.KEY_THRESHOLD2]]
+        th_vals = [threshold1, threshold2]
+        for row in range(constnumbers.NUM_SKILL2_GRID_ROW):
+            for col, th_val in zip(th_cols, th_vals):
+                val = self.skill2_grid.GetCellValue(row, col)
+                if val.isdigit() and int(val) >= th_val:
+                    self.skill2_grid.SetCellBackgroundColour(row, col, color)
+                else:
+                    self.skill2_grid.SetCellBackgroundColour(row, col, wx.NullColor)
+        self._set_inishie_highlight(skill_names, threshold1, threshold2, color)
+
+    def _set_inishie_highlight(self, skill_names, threshold1, threshold2, color="Yellow"):
+        u"""いにしえの錬金結果のハイライト"""
+        val = self.text_ctrl_inishie_skill2.GetValue()
+        if val in skill_names:
+            self.text_ctrl_inishie_skill2.SetBackgroundColour(color)
+        else:
+            self.text_ctrl_inishie_skill2.SetBackgroundColour(wx.NullColor)
+
+        for txt_ctrl, th_val in zip([self.text_ctrl_inishie_threshold1, self.text_ctrl_inishie_threshold2],
+                [threshold1, threshold2]):
+            val = txt_ctrl.GetValue()
+            if val.isdigit() and int(val) >= th_val:
+                txt_ctrl.SetBackgroundColour(color)
+            else:
+                txt_ctrl.SetBackgroundColour(wx.NullColor)
+
+    def clear_skill2_highlight(self):
+        u""" 表のハイライトをクリアする """
+        for row in range(constnumbers.NUM_SKILL2_GRID_ROW):
+            for col in range(constnumbers.NUM_SKILL2_GRID_COL):
+               self.skill2_grid.SetCellBackgroundColour(row, col, wx.NullColor)
+        self.text_ctrl_inishie_skill2.SetBackgroundColour(wx.NullColor)
+        self.text_ctrl_inishie_threshold1.SetBackgroundColour(wx.NullColor)
+        self.text_ctrl_inishie_threshold2.SetBackgroundColour(wx.NullColor)
+
+    def clear_skill2_grid(self):
+        u""" セルの内容をクリアする """
+        for row in range(constnumbers.NUM_SKILL2_GRID_ROW):
+            for col in range(constnumbers.NUM_SKILL2_GRID_COL):
+               self.skill2_grid.SetCellValue(row, col, u"")
+
+    def set_skill2_by_col_key(self, column_key, values):
+        u""" キーに対応する行に値をまとめて登録する """
+        col = constnumbers.DICT_SKILL2_GRID_COL[column_key]
+        for row, val in zip( range(constnumbers.NUM_SKILL2_GRID_ROW), values):
+            self.skill2_grid.SetCellValue(row, col, val)
+
+    def set_seed2_value(self, value):
+        u""" TextCtrlに与えられた値をセットする"""
+        self.text_ctrl_seed2_select.SetValue(u"{0}".format(value))
+
+    def get_seed2_value(self):
+        u""" TextCtrlから入力されたSeed2の値を得る。数値に変換できない時はNoneを返す"""
+        seed = self.text_ctrl_seed2_select.GetValue()
+        if seed.isdigit():
+            return int(seed)
+        else:
+            return None
+
+    def set_items_amulet_prospects(self, items):
+        u""" お守り予測リストにアイテムをセットする """
+        self.list_box_amulet_prospect.SetItems(items)
+
+    def clear_items_amulet_prospects(self):
+        u""" お守り予測リストからアイテムをクリアする """
+        self.list_box_amulet_prospect.Clear()
+
+    def clear_inishie(self):
+        u""" いにしえの錬金の結果のクリア """
+        self.text_ctrl_inishie_skill2.SetValue(u"")
+        self.text_ctrl_inishie_threshold1.SetValue(u"")
+        self.text_ctrl_inishie_threshold2.SetValue(u"")
+
+    def set_inishie(self, skill_name, threshold1, threshold2):
+        u""" いにしえの錬金の対応する値のセット """
+        self.text_ctrl_inishie_skill2.SetValue(u"{0}".format(skill_name))
+        self.text_ctrl_inishie_threshold1.SetValue(u"{0}".format(threshold1))
+        self.text_ctrl_inishie_threshold2.SetValue(u"{0}".format(threshold2))