1 //{Info 2 /* 3 ** Purpose: Code::Blocks - Autoversioning Plugin 4 ** Author: JGM 5 ** Created: 06/29/07 02:48:59 p.m. 6 ** Copyright: (c) JGM 7 ** License: GPL 8 */ 9 //} 10 11 #ifndef DLGVERSIONINTIALIZER_H 12 #define DLGVERSIONINTIALIZER_H 13 14 #include <typeinfo> 15 16 //(*Headers(avVersionEditorDlg) 17 #include <wx/combobox.h> 18 #include <wx/checkbox.h> 19 #include <wx/sizer.h> 20 #include <wx/notebook.h> 21 #include <wx/button.h> 22 #include <wx/panel.h> 23 #include "scrollingdialog.h" 24 #include <wx/statline.h> 25 #include <wx/stattext.h> 26 #include <wx/textctrl.h> 27 #include <wx/radiobox.h> 28 #include <wx/timer.h> 29 //*) 30 31 #include <wx/event.h> 32 33 class avVersionEditorDlg: public wxScrollingDialog 34 { 35 private: 36 long m_major; 37 long m_minor; 38 long m_build; 39 long m_count; 40 long m_revision; 41 bool m_autoMajorMinor; 42 bool m_dates; 43 // GJH 03/03/10 Added manifest updating. 44 bool m_updateManifest; 45 bool m_useDefine; 46 bool m_svn; 47 bool m_commit; 48 bool m_askCommit; 49 long m_minorMaximun; 50 long m_buildMaximun; 51 long m_revisionMaximun; 52 long m_revisionRandomMaximun; 53 long m_buildTimesToMinorIncrement; 54 long m_changes; 55 wxString m_headerGuard; 56 wxString m_namespace; 57 wxString m_prefix; 58 wxString m_svnDirectory; 59 wxString m_status; 60 wxString m_statusAbbreviation; 61 wxString m_changesTitle; 62 wxString m_language; 63 wxString m_headerPath; 64 wxString m_changesLogPath; 65 66 void ValidateInput(); 67 68 DECLARE_EVENT_TABLE() 69 70 71 public: 72 avVersionEditorDlg(wxWindow* parent,wxWindowID id = -1); 73 virtual ~avVersionEditorDlg(); 74 75 //(*Identifiers(avVersionEditorDlg) 76 static const long ID_MAJOR_LABEL; 77 static const long ID_MAJOR_TEXT; 78 static const long ID_MINOR_LABEL; 79 static const long ID_MINOR_TEXT; 80 static const long ID_BUILD_LABEL; 81 static const long ID_BUILD_TEXT; 82 static const long ID_REVISION_LABEL; 83 static const long ID_REVISION_TEXT; 84 static const long ID_STATICLINE2; 85 static const long ID_COUNT_LABEL; 86 static const long ID_COUNT_TEXT; 87 static const long ID_VALUES_PANEL; 88 static const long ID_SATUS_LABEL; 89 static const long ID_STATUS_COMBOBOX; 90 static const long ID_STATICLINE4; 91 static const long ID_STATICTEXT1; 92 static const long ID_ABBREVIATION_COMBOBOX; 93 static const long ID_STATUS_PANEL; 94 static const long ID_MINORMAXIMUN_LABEL; 95 static const long ID_MINORMAXIMUM_TEXT; 96 static const long ID_BUILDNUMBERMAX_LABEL; 97 static const long ID_BUILDNUMBERMAX_TEXT; 98 static const long ID_REVISIONMAX_LABEL; 99 static const long ID_REVISIONMAX_TEXT; 100 static const long ID_REVISIONRANDOM_LABEL; 101 static const long ID_REVISIONRANDOM_TEXT; 102 static const long ID_BUILDTIMES_LABEL; 103 static const long ID_BUILDTIMES_TEXT; 104 static const long ID_SCHEME_PANEL; 105 static const long ID_HEADER_GUARD_LABEL; 106 static const long ID_HEADER_GUARD_TEXT; 107 static const long ID_NAMESPACE_LABEL; 108 static const long ID_NAMESPACE_TEXT; 109 static const long ID_PREFIX_LABEL; 110 static const long ID_PREFIX_TEXT; 111 static const long ID_CODE_PANEL; 112 static const long ID_AUTO_CHECK; 113 static const long ID_DATES_CHECK; 114 static const long ID_DEFINE_CHECK; 115 static const long ID_UPDATE_MANIFEST; 116 static const long ID_COMMIT_CHECK; 117 static const long ID_ASKCOMMIT_CHECK; 118 static const long ID_STATICLINE3; 119 static const long ID_HEADERPATH_LABEL; 120 static const long ID_HEADERPATH_TEXTCTRL; 121 static const long ID_HEADERPATH_BUTTON; 122 static const long ID_HEADERLANGUAGE_RADIOBOX; 123 static const long ID_STATICLINE1; 124 static const long ID_SVN_CHECK; 125 static const long ID_SVNDIR_TEXT; 126 static const long ID_SVNDIR_BUTTON; 127 static const long ID_SETTINGS_PANEL; 128 static const long ID_GENERATECHANGES_CHECKBOX; 129 static const long ID_CHANGESPATH_STATICTEXT; 130 static const long ID_CHANGESLOGPATH_TEXTCTRL; 131 static const long ID_CHANGESLOGPATH_BUTTON; 132 static const long ID_FORMAT_STATICTEXT; 133 static const long ID_CHANGESTITLE_TEXTCTRL; 134 static const long ID_FORMATS_STATICTEXT; 135 static const long ID_CHANGES_PANEL; 136 static const long ID_AV_NOTEBOOK; 137 static const long ID_STATICTEXT2; 138 static const long ID_ACCEPT; 139 static const long ID_CANCEL; 140 static const long ID_VALIDATE_TIMER; 141 //*) 142 143 protected: 144 145 //(*Handlers(avVersionEditorDlg) 146 void OnAcceptClick(wxCommandEvent& event); 147 void OnCancelClick(wxCommandEvent& event); 148 void OnSvnCheck(wxCommandEvent& event); 149 void OnSvnDirectoryClick(wxCommandEvent& event); 150 void OnChkCommitClick(wxCommandEvent& event); 151 void OnChoStatusSelect(wxCommandEvent& event); 152 void OnChoAbbreviationSelect(wxCommandEvent& event); 153 void OnCmbStatusSelect(wxCommandEvent& event); 154 void OnCmbAbbreviationSelect(wxCommandEvent& event); 155 void OnChkChangesClick(wxCommandEvent& event); 156 void OnnbAutoVersioningPageChanged(wxNotebookEvent& event); 157 void OnTxtRevisionRandomText(wxCommandEvent& event); 158 void OnTmrValidateInputTrigger(wxTimerEvent& event); 159 void OnTextChanged(wxCommandEvent& event); 160 void OnMouseEnter(wxMouseEvent& event); 161 void OnHeaderPathClick(wxCommandEvent& event); 162 void OnChangesLogPathClick(wxCommandEvent& event); 163 //*) 164 165 //(*Declarations(avVersionEditorDlg) 166 wxPanel* pnlCode; 167 wxButton* btnAccept; 168 wxBoxSizer* buttonsSizer; 169 wxCheckBox* chkAutoIncrement; 170 wxStaticText* lblBuildTimes; 171 wxRadioBox* rbHeaderLanguage; 172 wxNotebook* nbAutoVersioning; 173 wxStaticText* lblChangesFormats; 174 wxButton* btnChangesLogPath; 175 wxBoxSizer* BoxSizer3; 176 wxStaticLine* StaticLine2; 177 wxTextCtrl* txtChangesLogPath; 178 wxStaticText* lblRevisionMax; 179 wxBoxSizer* statusSizer; 180 wxPanel* pnlVersionValues; 181 wxTextCtrl* txtChangesTitle; 182 wxCheckBox* chkSvn; 183 wxBoxSizer* BoxSizer7; 184 wxStaticText* lblCount; 185 wxComboBox* cmbStatus; 186 wxCheckBox* chkChanges; 187 wxCheckBox* chkAskCommit; 188 wxPanel* pnlSettings; 189 wxBoxSizer* minorMaxSizer; 190 wxBoxSizer* BoxSizer2; 191 wxStaticText* lblMinorMaximum; 192 wxTextCtrl* txtNameSpace; 193 wxStaticText* StaticText1; 194 wxTimer tmrValidateInput; 195 wxStaticText* lblRevisionRandom; 196 wxBoxSizer* mainSizer; 197 wxCheckBox* chkCommit; 198 wxButton* btnHeaderPath; 199 wxBoxSizer* changesSizer; 200 wxBoxSizer* BoxSizer9; 201 wxPanel* pnlStatus; 202 wxBoxSizer* settingsSizer; 203 wxTextCtrl* txtPrefix; 204 wxBoxSizer* buildNumberMaxSizer; 205 wxStaticText* lblStatus; 206 wxStaticText* lblPrefix; 207 wxTextCtrl* txtRevisionRandom; 208 wxTextCtrl* txtBuildNumber; 209 wxPanel* pnlChanges; 210 wxStaticLine* StaticLine1; 211 wxBoxSizer* valuesSizer; 212 wxStaticText* lblChangesPath; 213 wxCheckBox* chkUpdateManifest; 214 wxStaticText* lblHeaderPath; 215 wxBoxSizer* BoxSizer19; 216 wxBoxSizer* BoxSizer4; 217 wxStaticLine* StaticLine3; 218 wxStaticText* lblNamespace; 219 wxTextCtrl* txtMajorVersion; 220 wxStaticText* lblBuildNumberMaximun; 221 wxBoxSizer* BoxSizer8; 222 wxButton* btnSvnDir; 223 wxPanel* pnlScheme; 224 wxTextCtrl* txtBuildCount; 225 wxTextCtrl* txtBuildNumberMaximun; 226 wxTextCtrl* txtMinorVersion; 227 wxCheckBox* chkDefine; 228 wxStaticText* lblHeaderGuard; 229 wxBoxSizer* BoxSizer1; 230 wxStaticText* lblBuild; 231 wxComboBox* cmbAbbreviation; 232 wxStaticText* lblMinor; 233 wxTextCtrl* txtRevisionMax; 234 wxButton* btnCancel; 235 wxTextCtrl* txtHeaderPath; 236 wxStaticLine* StaticLine4; 237 wxBoxSizer* BoxSizer12; 238 wxTextCtrl* txtHeaderGuard; 239 wxTextCtrl* txtBuildTimes; 240 wxTextCtrl* txtMinorMaximun; 241 wxStaticText* lblCurrentProject; 242 wxBoxSizer* BoxSizer6; 243 wxBoxSizer* svnSizer; 244 wxTextCtrl* txtRevisionNumber; 245 wxBoxSizer* schemeSizer; 246 wxStaticText* lblMajor; 247 wxTextCtrl* txtSvnDir; 248 wxBoxSizer* BoxSizer5; 249 wxStaticText* lblRevision; 250 wxCheckBox* chkDates; 251 wxStaticText* lblChangesTitle; 252 //*) 253 254 public: 255 void SetCurrentProject(const wxString& projectName); 256 257 void SetMajor(long value); 258 void SetMinor(long value); 259 void SetBuild(long value); 260 void SetRevision(long value); 261 void SetCount(long value); 262 263 void SetStatus(const wxString& value); 264 void SetStatusAbbreviation(const wxString& value); 265 GetMajor()266 long GetMajor() const {return m_major;} GetMinor()267 long GetMinor() const {return m_minor;} GetBuild()268 long GetBuild() const {return m_build;} GetRevision()269 long GetRevision() const {return m_revision;} GetCount()270 long GetCount() const {return m_count;} 271 GetStatus()272 wxString GetStatus() const {return m_status;} GetStatusAbbreviation()273 wxString GetStatusAbbreviation() const {return m_statusAbbreviation;} 274 275 276 void SetSvn(bool value); 277 void SetSvnDirectory(const wxString& value); 278 void SetAuto(bool value); 279 void SetDates(bool value); 280 void SetDefine(bool value); 281 // GJH 03/03/10 Added manifest updating. 282 void SetManifest(bool value); 283 void SetCommit(bool value); 284 void SetCommitAsk(bool value); 285 void SetLanguage(const wxString& value); 286 void SetHeaderPath(const wxString& value); 287 288 void SetMinorMaximum(long value); 289 void SetBuildMaximum(long value); 290 void SetRevisionMaximum(long value); 291 void SetRevisionRandomMaximum(long value); 292 void SetBuildTimesToMinorIncrement(long value); 293 294 void SetChanges(bool value); 295 void SetChangesLogPath(const wxString& value); 296 void SetChangesTitle(const wxString& value); 297 GetSvn()298 bool GetSvn() const {return m_svn;} GetSvnDirectory()299 wxString GetSvnDirectory() const {return m_svnDirectory;} GetAuto()300 bool GetAuto() const {return m_autoMajorMinor;} GetDates()301 bool GetDates() const {return m_dates;} GetDefine()302 bool GetDefine() const {return m_useDefine;} 303 // GJH 03/03/10 Added manifest updating. GetManifest()304 bool GetManifest() const {return m_updateManifest;} GetCommit()305 bool GetCommit() const {return m_commit;} GetCommitAsk()306 bool GetCommitAsk() const {return m_askCommit;} GetLanguage()307 wxString GetLanguage() const {return m_language;} GetHeaderPath()308 wxString GetHeaderPath() const {return m_headerPath;} 309 GetMinorMaximum()310 long GetMinorMaximum() const {return m_minorMaximun;} GetBuildMaximum()311 long GetBuildMaximum() const {return m_buildMaximun;} GetRevisionMaximum()312 long GetRevisionMaximum() const {return m_revisionMaximun;} GetRevisionRandomMaximum()313 long GetRevisionRandomMaximum() const {return m_revisionRandomMaximun;} GetBuildTimesToMinorIncrement()314 long GetBuildTimesToMinorIncrement() const {return m_buildTimesToMinorIncrement;} 315 GetChanges()316 bool GetChanges() const {return m_changes;} GetChangesLogPath()317 wxString GetChangesLogPath() const {return m_changesLogPath;} GetChangesTitle()318 wxString GetChangesTitle() const {return m_changesTitle;} 319 320 void SetHeaderGuard(const wxString& value); 321 void SetNamespace(const wxString& value); 322 void SetPrefix(const wxString& value); 323 GetHeaderGuard()324 wxString GetHeaderGuard() const {return m_headerGuard;} GetNamespace()325 wxString GetNamespace() const {return m_namespace;} GetPrefix()326 wxString GetPrefix() const {return m_prefix;} 327 328 329 }; 330 331 #endif 332