00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DIALOGS_H
00023 #define DIALOGS_H
00024
00025 #include <gtkmm/button.h>
00026 #include <gtkmm/comboboxtext.h>
00027 #include <gtkmm/dialog.h>
00028 #include <gtkmm/entry.h>
00029 #include <gtkmm/image.h>
00030 #include <gtkmm/label.h>
00031 #include <gtkmm/liststore.h>
00032 #include <gtkmm/listviewtext.h>
00033 #include <gtkmm/notebook.h>
00034 #include <gtkmm/progressbar.h>
00035 #include <gtkmm/scale.h>
00036 #include <gtkmm/scrolledwindow.h>
00037 #include <gtkmm/textbuffer.h>
00038 #include <gtkmm/textview.h>
00039 #include <gtkmm/togglebutton.h>
00040
00041 #include "case.h"
00042 #include "casecombobox.h"
00043 #include "character.h"
00044 #include "colorwidget.h"
00045 #include "hotspotwidget.h"
00046
00049 class ChangeSpeedDialog: public Gtk::Dialog {
00050 public:
00052 ChangeSpeedDialog();
00053
00057 Glib::ustring get_text_speed();
00058
00059 private:
00060
00061 void construct();
00062
00063
00064 void on_value_changed();
00065
00066
00067 Gtk::Button *m_OKButton;
00068
00069
00070 Gtk::Label *m_SlowerLabel;
00071 Gtk::Label *m_FasterLabel;
00072
00073
00074 Gtk::HScale *m_Scale;
00075 };
00076
00077
00078
00081 class ChangeColorDialog: public Gtk::Dialog {
00082 public:
00084 ChangeColorDialog();
00085
00089 Glib::ustring get_color();
00090
00091 private:
00092
00093 void construct();
00094
00095
00096 Gtk::RadioButton *m_BlueButton;
00097 Gtk::RadioButton *m_GreenButton;
00098 Gtk::RadioButton *m_OrangeButton;
00099 Gtk::RadioButton *m_WhiteButton;
00100
00101
00102 Gtk::RadioButtonGroup m_Group;
00103 };
00104
00105
00106
00109 class ProgressDialog: public Gtk::Dialog {
00110 public:
00114 ProgressDialog(const Glib::ustring &label);
00115
00119 void set_progress(double amount);
00120
00121 private:
00122
00123 void construct();
00124
00125
00126 Gtk::Label *m_Label;
00127
00128
00129 Gtk::ProgressBar *m_ProgBar;
00130 };
00131
00132
00133
00136 class TestimonyManager: public Gtk::Dialog {
00137 public:
00142 TestimonyManager(const TestimonyMap &tmap, const StringVector &testimonyIds);
00143
00147 TestimonyMap get_testimonies() const { return m_Testimonies; }
00148
00149 private:
00150
00151 void construct();
00152
00153
00154 void on_add_button_clicked();
00155
00156
00157 void on_edit_button_clicked();
00158
00159
00160 void on_delete_button_clicked();
00161
00162
00163 void on_selection_changed();
00164
00165
00166 Gtk::Label *m_TitleLabel;
00167 Gtk::Label *m_PreviewLabel;
00168
00169
00170 Gtk::Button *m_AddButton;
00171 Gtk::Button *m_EditButton;
00172 Gtk::Button *m_DeleteButton;
00173
00174
00175 Gtk::ScrolledWindow *m_SWindow;
00176 Gtk::ListViewText *m_ListView;
00177
00178
00179 TestimonyMap m_Testimonies;
00180 StringVector m_Ids;
00181 };
00182
00183
00184
00187 class ImageDialog: public Gtk::Dialog {
00188 public:
00193 ImageDialog(const ImageMap &imap, const StringVector &imgIds);
00194
00198 ImageMap get_images() const { return m_Images; }
00199
00200 private:
00201
00202 void construct();
00203
00204
00205 void on_add_clicked();
00206
00207
00208 void on_delete_clicked();
00209
00210
00211 void on_selection_changed();
00212
00213
00214 Gtk::Label *m_ImageLabel;
00215 Gtk::Label *m_PreviewLabel;
00216
00217
00218 Gtk::Button *m_AddButton;
00219 Gtk::Button *m_DeleteButton;
00220
00221
00222 Gtk::ScrolledWindow *m_SWindow;
00223
00224
00225 Gtk::ListViewText *m_ImageList;
00226
00227
00228 Gtk::Image *m_Image;
00229
00230
00231 ImageMap m_Images;
00232 StringVector m_ImageIds;
00233 };
00234
00235
00236
00239 class NewHotspotDialog: public Gtk::Dialog {
00240 public:
00242 NewHotspotDialog();
00243
00247 void set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf> &pixbuf) { m_HSWidget->set_image(pixbuf); }
00248
00252 Case::Hotspot get_hotspot();
00253
00254 private:
00255
00256 void construct();
00257
00258
00259 void on_point_changed(int x, int y);
00260
00261
00262 void on_dimensions_changed(int w, int h);
00263
00264
00265 void on_coord_entry_changed();
00266
00267
00268 void on_dimension_entry_changed();
00269
00270
00271 Gtk::Label *m_XLabel;
00272 Gtk::Label *m_YLabel;
00273 Gtk::Label *m_WLabel;
00274 Gtk::Label *m_HLabel;
00275 Gtk::Label *m_BlockLabel;
00276
00277
00278 Gtk::Entry *m_XEntry;
00279 Gtk::Entry *m_YEntry;
00280 Gtk::Entry *m_WEntry;
00281 Gtk::Entry *m_HEntry;
00282 Gtk::Entry *m_BlockEntry;
00283
00284
00285 HotspotWidget *m_HSWidget;
00286 };
00287
00288
00289
00292 class LocationsDialog: public Gtk::Dialog {
00293 public:
00299 LocationsDialog(const LocationMap &locations, const BackgroundMap &bgs, const StringVector &usedIds);
00300
00304 LocationMap get_locations() const { return m_Locations; }
00305
00306 private:
00307
00308 void construct();
00309
00310
00311 void on_add();
00312
00313
00314 void on_delete();
00315
00316
00317 void on_add_hotspot();
00318
00319
00320 void on_delete_hotspot();
00321
00322
00323 void on_amend_button_clicked();
00324
00325
00326 void on_selection_changed();
00327
00328
00329 Gtk::Button *m_AddButton;
00330 Gtk::Button *m_DeleteButton;
00331 Gtk::Button *m_AddHSButton;
00332 Gtk::Button *m_DeleteHSButton;
00333 Gtk::Button *m_AmendButton;
00334
00335
00336 Gtk::Label *m_LocationsLabel;
00337 Gtk::Label *m_DetailsLabel;
00338 Gtk::Label *m_IdLabel;
00339 Gtk::Label *m_NameLabel;
00340 Gtk::Label *m_BGLabel;
00341 Gtk::Label *m_HotspotsLabel;
00342
00343
00344 Gtk::Entry *m_IdEntry;
00345 Gtk::Entry *m_NameEntry;
00346 Gtk::Entry *m_BGEntry;
00347
00348
00349 Gtk::ScrolledWindow *m_SWindow;
00350 Gtk::ScrolledWindow *m_HotspotSWindow;
00351
00352
00353 Gtk::TreeView *m_TreeView;
00354 Glib::RefPtr<Gtk::ListStore> m_Model;
00355
00356
00357 class ColumnRec: public Gtk::TreeModel::ColumnRecord {
00358 public:
00359
00360 ColumnRec() {
00361 add(m_Column);
00362 }
00363
00364
00365 Gtk::TreeModelColumn<Glib::ustring> m_Column;
00366 };
00367
00368
00369 ColumnRec m_ColumnRec;
00370
00371
00372 Gtk::ListViewText *m_HotspotList;
00373
00374
00375 LocationMap m_Locations;
00376 BackgroundMap m_Backgrounds;
00377 StringVector m_UsedIds;
00378 };
00379
00380
00381
00384 class SpriteChooserDialog: public Gtk::Dialog {
00385 public:
00387 enum SpriteMode { SPRITE_NEW=0, SPRITE_EXISTING, SPRITE_FROM_GIFS };
00388
00390 SpriteChooserDialog();
00391
00395 SpriteMode get_sprite_mode() const;
00396
00400 Glib::ustring get_path() const { return m_PathEntry->get_text(); }
00401
00402 private:
00403
00404 void construct();
00405
00406
00407 void on_browse_button_clicked();
00408
00409
00410 void on_new_sprite_toggled();
00411
00412
00413 void on_open_sprite_toggled();
00414
00415
00416 void on_from_gifs_toggled();
00417
00418
00419 Gtk::RadioButtonGroup m_Group;
00420 Gtk::RadioButton *m_NewSpriteRB;
00421 Gtk::RadioButton *m_OpenSpriteRB;
00422 Gtk::RadioButton *m_CreateFromGifsRB;
00423
00424
00425 Gtk::Label *m_SpriteLabel;
00426 Gtk::Label *m_PathLabel;
00427
00428
00429 Gtk::Entry *m_PathEntry;
00430
00431
00432 Gtk::Button *m_BrowseButton;
00433 };
00434
00435
00436
00440 class TextInputDialog: public Gtk::Dialog {
00441 public:
00446 TextInputDialog(const Glib::ustring &label="Input text:", const Glib::ustring &defaultValue="");
00447
00451 Glib::ustring get_text() const { return m_Entry->get_text(); }
00452
00453 private:
00454
00455 void construct(const Glib::ustring &label, const Glib::ustring &defaultValue);
00456
00457
00458 Gtk::Label *m_Label;
00459
00460
00461 Gtk::Entry *m_Entry;
00462 };
00463
00464
00465
00468 class AudioDialog: public Gtk::Dialog {
00469 public:
00471 AudioDialog();
00472
00476 void set_audio(const AudioMap &audio);
00477
00481 AudioMap get_audio_data();
00482
00483 private:
00484
00485 void construct();
00486
00487
00488 void on_add_audio();
00489
00490
00491 void on_remove_audio();
00492
00493
00494 Gtk::Label *m_AudioLabel;
00495
00496
00497 Gtk::ScrolledWindow *m_SWindow;
00498
00499
00500 Gtk::Button *m_AddButton;
00501 Gtk::Button *m_DeleteButton;
00502
00503
00504 Glib::RefPtr<Gtk::ListStore> m_Model;
00505 Gtk::TreeView *m_AudioList;
00506
00507
00508 class ColumnRec: public Gtk::TreeModel::ColumnRecord {
00509 public:
00510 ColumnRec() {
00511 add(m_NameCol);
00512 add(m_IdCol);
00513 }
00514
00515
00516 Gtk::TreeModelColumn<Glib::ustring> m_NameCol;
00517 Gtk::TreeModelColumn<Glib::ustring> m_IdCol;
00518 };
00519
00520
00521 ColumnRec m_ColRec;
00522 };
00523
00524
00525
00528 class NewEvidenceDialog: public Gtk::Dialog {
00529 public:
00533 NewEvidenceDialog(const StringVector &ids);
00534
00538 Case::Evidence get_evidence_data();
00539
00543 Glib::ustring get_image_path() const { return m_PathEntry->get_text(); }
00544
00545 private:
00546
00547 void construct();
00548
00549
00550 void on_id_changed();
00551
00552
00553 void on_browse_button_clicked();
00554
00555
00556 Gtk::Label *m_PathLabel;
00557 Gtk::Label *m_IdLabel;
00558
00559
00560 Gtk::Entry *m_PathEntry;
00561 Gtk::Entry *m_IdEntry;
00562
00563
00564 Gtk::Button *m_BrowseButton;
00565 Gtk::Button *m_OKButton;
00566
00567
00568 StringVector m_UsedIds;
00569 };
00570
00571
00572
00575 class EvidenceDialog: public Gtk::Dialog {
00576 public:
00582 EvidenceDialog(const EvidenceMap &evidence,
00583 const ImageMap &images,
00584 const StringVector &evidenceIds);
00585
00589 EvidenceMap get_evidence() const { return m_Evidence; }
00590
00591 private:
00592
00593 void construct(const ImageMap &images);
00594
00595
00596 void on_check_img_toggled();
00597
00598
00599 void on_add();
00600
00601
00602 void on_delete();
00603
00604
00605 void on_amend_button_clicked();
00606
00607
00608 void on_selection_changed();
00609
00610
00611 Gtk::TreeView *m_TreeView;
00612 Glib::RefPtr<Gtk::ListStore> m_Model;
00613
00614
00615 Gtk::Label *m_EvidenceLabel;
00616 Gtk::Label *m_PreviewLabel;
00617 Gtk::Label *m_InternalLabel;
00618 Gtk::Label *m_NameLabel;
00619 Gtk::Label *m_CaptionLabel;
00620 Gtk::Label *m_DescLabel;
00621
00622
00623 Gtk::ScrolledWindow *m_SWindow;
00624
00625
00626 Gtk::Image *m_Image;
00627
00628
00629 Gtk::Entry *m_InternalEntry;
00630 Gtk::Entry *m_NameEntry;
00631 Gtk::Entry *m_CaptionEntry;
00632 Gtk::Entry *m_DescEntry;
00633
00634
00635 Gtk::CheckButton *m_HasImgCB;
00636
00637
00638 ImgComboBox *m_ImgCB;
00639
00640
00641 Gtk::Button *m_AddButton;
00642 Gtk::Button *m_DeleteButton;
00643 Gtk::Button *m_AmendButton;
00644
00645
00646 class ColumnRec: public Gtk::TreeModel::ColumnRecord {
00647 public:
00648
00649 ColumnRec() {
00650 add(m_Column);
00651 }
00652
00653
00654 Gtk::TreeModelColumn<Glib::ustring> m_Column;
00655 };
00656
00657
00658 ColumnRec m_ColumnRec;
00659
00660
00661 EvidenceMap m_Evidence;
00662 StringVector m_EvidenceIds;
00663 };
00664
00665
00666
00669 class BackgroundsDialog: public Gtk::Dialog {
00670 public:
00675 BackgroundsDialog(const BackgroundMap &bgs,
00676 const StringVector &bgIds);
00677
00681 BackgroundMap get_backgrounds() const { return m_Backgrounds; }
00682
00683 private:
00684
00685 void construct();
00686
00687
00688 void on_add();
00689
00690
00691 void on_delete();
00692
00693
00694 void on_selection_changed();
00695
00696
00697 Gtk::ScrolledWindow *m_SWindow;
00698
00699
00700 Gtk::TreeView *m_ListView;
00701 Glib::RefPtr<Gtk::ListStore> m_ListModel;
00702
00703
00704 Gtk::Image *m_Image;
00705
00706
00707 Gtk::Label *m_BGLabel;
00708 Gtk::Label *m_PreviewLabel;
00709
00710
00711 Gtk::Button *m_AddButton;
00712 Gtk::Button *m_DeleteButton;
00713
00714
00715 class ColumnRec: public Gtk::TreeModel::ColumnRecord {
00716 public:
00717
00718 ColumnRec() {
00719 add(m_Column);
00720 }
00721
00722
00723 Gtk::TreeModelColumn<Glib::ustring> m_Column;
00724 };
00725
00726
00727 ColumnRec m_ColumnRec;
00728
00729
00730 BackgroundMap m_Backgrounds;
00731 StringVector m_BGIds;
00732 };
00733
00734
00735
00738 class NewBackgroundDialog: public Gtk::Dialog {
00739 public:
00743 NewBackgroundDialog(const StringVector &bgIds);
00744
00748 Case::Background get_background_data();
00749
00753 Glib::ustring get_path() const { return m_PathEntry->get_text(); }
00754
00755 private:
00756
00757 void construct();
00758
00759
00760 void on_browse_button_clicked();
00761
00762
00763 void on_id_changed();
00764
00765
00766 Gtk::Label *m_PathLabel;
00767 Gtk::Label *m_IdLabel;
00768 Gtk::Label *m_TypeLabel;
00769
00770
00771 Gtk::Entry *m_PathEntry;
00772 Gtk::Entry *m_IdEntry;
00773
00774
00775 Gtk::RadioButton::Group m_RBGroup;
00776 Gtk::RadioButton *m_SingleScreenRB;
00777 Gtk::RadioButton *m_DoubleScreenRB;
00778
00779
00780 Gtk::Button *m_OKButton;
00781 Gtk::Button *m_BrowseButton;
00782
00783
00784 StringVector m_UsedBGs;
00785 };
00786
00787
00788
00791 class NewDialog: public Gtk::Dialog {
00792 public:
00794 NewDialog();
00795
00799 void set_overview(const Case::Overview &overview);
00800
00804 Case::Overview get_overview();
00805
00806 private:
00807
00808 void construct();
00809
00810
00811 Gtk::Label *m_CaseNameLabel;
00812 Gtk::Label *m_CaseAuthorLabel;
00813 Gtk::Label *m_LawSysLabel;
00814
00815
00816 Gtk::Entry *m_CaseNameEntry;
00817 Gtk::Entry *m_CaseAuthorEntry;
00818
00819
00820 Gtk::ComboBoxText *m_LawSysCB;
00821 };
00822
00823
00824
00827 class CharBrowser: public Gtk::Dialog {
00828 public:
00832 CharBrowser(const CharacterMap &cmap);
00833
00837 bool was_changed() const { return m_CharChanged; }
00838
00842 CharacterMap get_characters() const { return m_CharacterMap; }
00843
00844 private:
00845
00846 void construct();
00847
00848
00849 void on_edit_button_clicked();
00850
00851
00852 void on_combo_box_changed();
00853
00854
00855 bool m_CharChanged;
00856
00857
00858 Gtk::Label *m_CharacterLabel;
00859 Gtk::Label *m_InternalLabel;
00860 Gtk::Label *m_NameLabel;
00861 Gtk::Label *m_DescLabel;
00862
00863
00864 Gtk::Entry *m_InternalEntry;
00865 Gtk::Entry *m_NameEntry;
00866 Gtk::Entry *m_DescEntry;
00867
00868
00869 Gtk::Button *m_EditButton;
00870
00871
00872 Gtk::ComboBoxText *m_CharCB;
00873
00874
00875 CharacterMap m_CharacterMap;
00876 };
00877
00878
00879
00882 class NewCharDialog: public Gtk::Dialog {
00883 public:
00887 NewCharDialog(const StringVector &names);
00888
00892 void set_character_data(const Character &ch);
00893
00897 Character get_character_data();
00898
00899 private:
00900
00901 void construct();
00902
00903
00904 void on_internal_name_changed();
00905
00906
00907 void on_check_button_clicked(const Glib::ustring &buttonId);
00908
00909
00910 void on_browse_button_clicked(const Glib::ustring &buttonId);
00911
00912
00913 bool m_CheckInternals;
00914
00915
00916 Gtk::Container* build_general_page();
00917
00918
00919 Gtk::Container* build_graphics_page();
00920
00921
00922 Gtk::RadioButtonGroup m_Group;
00923 Gtk::RadioButton *m_MaleRB;
00924 Gtk::RadioButton *m_FemaleRB;
00925 Gtk::RadioButton *m_UnknownRB;
00926
00927
00928 Gtk::CheckButton *m_HasTagCB;
00929 Gtk::CheckButton *m_HasHeadshotCB;
00930
00931
00932 Gtk::Notebook *m_NB;
00933
00934
00935 Gtk::Button *m_OKButton;
00936 Gtk::Button *m_TagBrowseButton;
00937 Gtk::Button *m_HeadshotBrowseButton;
00938
00939
00940 Gtk::Label *m_CodeNameLabel;
00941 Gtk::Label *m_NameLabel;
00942 Gtk::Label *m_GenderLabel;
00943 Gtk::Label *m_CapLabel;
00944 Gtk::Label *m_DescLabel;
00945 Gtk::Label *m_SpriteLabel;
00946 Gtk::Label *m_TextBoxLabel;
00947 Gtk::Label *m_HeadshotLabel;
00948
00949
00950 Gtk::Entry *m_CodeNameEntry;
00951 Gtk::Entry *m_NameEntry;
00952 Gtk::Entry *m_CapEntry;
00953 Gtk::Entry *m_DescEntry;
00954 Gtk::Entry *m_SpriteEntry;
00955
00956
00957 Gtk::Image *m_TextBoxImage;
00958 Gtk::Image *m_HeadshotImage;
00959
00960
00961 StringVector m_UsedNames;
00962 };
00963
00964
00965
00968 class InitialBlockDialog: public Gtk::Dialog {
00969 public:
00974 InitialBlockDialog(const Glib::ustring &id, BufferMap blocks);
00975
00979 Glib::ustring get_selected_block_id() const { return m_BlocksCB->get_active_text(); }
00980
00981 private:
00982
00983 void construct();
00984
00985
00986 void on_block_changed();
00987
00988
00989 Gtk::ScrolledWindow *m_SWindow;
00990
00991
00992 Gtk::TextView *m_TextPreview;
00993
00994
00995 Gtk::ComboBoxText *m_BlocksCB;
00996
00997
00998 Gtk::Label *m_BlockLabel;
00999 Gtk::Label *m_PreviewLabel;
01000
01001
01002 BufferMap m_Blocks;
01003 };
01004
01005 #endif