1 #pragma once 2 #include "afxcmn.h" 3 #include "afxwin.h" 4 #include "express_combobox.h" 5 6 // ProjectConfigWin dialog 7 8 class ProjectConfigWin : public CDialog 9 { 10 DECLARE_DYNAMIC(ProjectConfigWin) 11 12 public: 13 ProjectConfigWin(CWnd* pParent = NULL, int current_display = 0); // standard constructor 14 virtual ~ProjectConfigWin(); 15 16 int GetGuixVersion(); 17 BOOL Save(); 18 BOOL Cancel(); 19 20 // Dialog Data 21 enum { IDD = IDD_CONFIGURE_PROJECT_WIN }; 22 23 protected: OnOK()24 virtual void OnOK() {}; OnCancel()25 virtual void OnCancel() {}; 26 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 27 virtual BOOL OnInitDialog(); 28 void InitDisplayConfig(int display_num); 29 void SaveDisplayConfig(int display_index); 30 31 int GetBitsSelected(); 32 void BitDepthChanged(); 33 void Format4444Clicked(); 34 void Format1555Clicked(); 35 void Format332Clicked(); 36 void EnableDisable(int bits_per_pix, studiox_project *project); 37 void OffAndDisable(int id); 38 void EnableDisableAdvancedSettings(int cpu_type); 39 void EnableDisableAATextColorsSetting(); 40 void EnableDisableCCRX(int cpu_type); 41 void InitAATextColorsCombobox(); 42 void InitRotationAnglesCombobox(int display); 43 void EnableDisableFlipRotation(int cpu_type); 44 45 CWnd *mpParent; 46 CScrollHelper *m_scroll_helper; 47 int m_current_display; 48 studiox_project *mpProject; 49 int mGuixVersion; 50 express_combobox mCpuCombo; 51 express_combobox mToolsCombo; 52 express_combobox mAATextColorsCombo; 53 project_header mOldHeader; 54 55 CSpinButtonCtrl m_spin_current_screen; 56 CSpinButtonCtrl m_spin_num_screens; 57 58 CSpinButtonCtrl mSpinMajorVersion; 59 CSpinButtonCtrl mSpinMinorVersion; 60 CSpinButtonCtrl mSpinServicePack; 61 62 DECLARE_MESSAGE_MAP() 63 64 public: 65 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 66 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 67 afx_msg void OnSize(UINT nType, int cx, int cy); 68 afx_msg void OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt); 69 afx_msg void OnDeltaposSpinNumScreens(NMHDR *pNMHDR, LRESULT *pResult); 70 afx_msg void OnDeltaposSpinScreenSelect(NMHDR *pNMHDR, LRESULT *pResult); 71 72 afx_msg void OnEnEditNumScreens(); 73 afx_msg void OnEnEditSelectedDisplay(); 74 afx_msg void OnEnEditMajorVersion(); 75 afx_msg void OnEnEditMinorVersion(); 76 afx_msg void OnEnEditServicePack(); 77 78 afx_msg void OnBnClickedBrowseSource(); 79 afx_msg void OnBnClickedBrowseHeader(); 80 afx_msg void OnBnClickedBrowseResource(); 81 82 afx_msg void OnAdvancedSettings(); 83 afx_msg void OnChangeSelectedCPU(); 84 afx_msg void OnEditXRes(); 85 afx_msg void OnEditYRes(); 86 virtual BOOL PreTranslateMessage(MSG *pMsg); 87 afx_msg LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam); 88 }; 89 90 // ProjectConfigDlg dialog 91 92 class ProjectConfigDlg : public express_dialog 93 { 94 DECLARE_DYNAMIC(ProjectConfigDlg) 95 96 public: 97 ProjectConfigDlg(CWnd* pParent = NULL, int current_display = 0); // standard constructor 98 virtual ~ProjectConfigDlg(); 99 100 static void CreateDefault1BppPalette(palette_info& info); 101 static void CreateDefault4BppPalette(palette_info& info); 102 static void CreateDefault332RGBPalette(palette_info& info); 103 static void CreateDefault8BppPalette(palette_info& info); 104 static void CreateDefaultPalette(studiox_project* project, int display, int theme); 105 static COLOR_RECORD* GetDefaultColorTable(int color_format); 106 static void ColorTableConvert(res_info* info, GX_COLOR* old_pal, int old_palsize, int old_color_format, GX_COLOR* new_pal, int new_palsize, int new_color_format); 107 static GX_COLOR GetRGBColor(GX_COLOR colorval, GX_COLOR* old_pal, int old_palsize, int old_color_format); 108 static GX_COLOR GetColorVal(GX_COLOR rgb_color, GX_COLOR* new_pal, int new_palsize, int new_color_format); 109 static void CheckFontFormat(res_info* start, int m_display); 110 static void DisableTextScrollWheelRoundStyle(widget_info* info); 111 static void ResetPixelmapFormat(res_info* start, int m_display); 112 static CString FindTargetCPUName(int val); 113 static int FindTargetCPUVal(CString name); 114 static CString FindTargetCompilerName(int val); 115 static int FindTargetCompilerVal(CString name); 116 static CString FindScreenRotationName(int val); 117 static int FindScreenRotationVal(CString name); 118 119 // Dialog Data 120 enum { IDD = IDD_CONFIGURE_PROJECT }; 121 122 public: 123 int GetGuixVersion(); 124 void PositionChildren(); 125 126 protected: 127 virtual BOOL OnInitDialog(); 128 virtual void OnOK(); 129 virtual void OnCancel(); 130 afx_msg void OnSize(UINT nType, int cx, int cy); 131 afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); 132 LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam); 133 DECLARE_MESSAGE_MAP() 134 135 private: 136 ProjectConfigWin* mpProjectConfigWin; 137 int mCurrentDisplay; 138 }; 139