| 1 |
From: Morten Kjeldgaard <[email protected]> |
| 2 |
Subject: modification to source code |
| 3 |
|
| 4 |
|
| 5 |
--- a/src/saveSnapDialog.cpp |
| 6 |
+++ b/src/saveSnapDialog.cpp |
| 7 |
@@ -3,15 +3,15 @@ |
| 8 |
#endif |
| 9 |
|
| 10 |
#include <vector> |
| 11 |
|
| 12 |
+#include "saveSnapDialog.h" |
| 13 |
#include "HardSettings.h" |
| 14 |
|
| 15 |
|
| 16 |
enum{ ID_ResUp=500, ID_ResDown, ID_Res, ID_AntiAlias, ID_Alpha}; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
+static wxString title[]={_T("PNG snapshot options"),_T("JPG snapshot options"),_T("GIF animation options")}; |
| 22 |
+//static wxTextCtrl * resText; |
| 23 |
+//static wxCheckBox *wxCheckAntia, *wxTransp ; |
| 24 |
|
| 25 |
class EventTableEntry{ |
| 26 |
public: |
| 27 |
@@ -132,16 +132,16 @@ |
| 28 |
enableif=lastRadio=NULL; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
+ void EndEnableGroup(){ |
| 33 |
enableif=NULL; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
+ void StartEnableGroup(){ |
| 38 |
enableif=lastRadio; |
| 39 |
} |
| 40 |
|
| 41 |
bool pressButton(wxWindowID x){ |
| 42 |
|
| 43 |
+ for (int i=0; i < (int)data.size(); i++) { |
| 44 |
if (data[i].idButMore==x) { data[i].More(); return true;} |
| 45 |
if (data[i].idButLess==x) { data[i].Less();return true;} |
| 46 |
} |
| 47 |
@@ -149,27 +149,27 @@ |
| 48 |
} |
| 49 |
|
| 50 |
bool pressRadioButton(wxWindowID x){ |
| 51 |
|
| 52 |
+ for (int i=0; i < (int)data.size(); i++) |
| 53 |
if (data[i].idRadio==x) { data[i].SetRadioButton();return true;} |
| 54 |
return false; |
| 55 |
} |
| 56 |
|
| 57 |
bool pressCheck(wxWindowID x){ |
| 58 |
|
| 59 |
+ for (int i=0; i < (int)data.size(); i++) |
| 60 |
if (data[i].idCheck==x) { data[i].SetCheck();return true;} |
| 61 |
return false; |
| 62 |
} |
| 63 |
|
| 64 |
void Enable(){ |
| 65 |
|
| 66 |
+ for (int i=0; i < (int)data.size(); i++) data[i].Enable(); |
| 67 |
} |
| 68 |
|
| 69 |
void transfer(){ |
| 70 |
|
| 71 |
+ for (int i=0; i < (int)data.size(); i++) data[i].Transfer(); |
| 72 |
} |
| 73 |
|
| 74 |
bool insertText(wxWindowID x){ |
| 75 |
|
| 76 |
+ for (int i=0; i < (int)data.size(); i++) |
| 77 |
if (data[i].idText==x) { data[i].SetFromText();return true;} |
| 78 |
return false; |
| 79 |
} |
| 80 |
@@ -210,7 +210,7 @@ |
| 81 |
//checkButton but=new |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
+ void AddNewInt(wxString label, int *dataz, int min, int max, bool pow2, int delta){ |
| 86 |
EventTableEntry e; |
| 87 |
|
| 88 |
e.idText=newID(); |
| 89 |
@@ -268,11 +268,14 @@ |
| 90 |
int jj=event.GetId(); |
| 91 |
if (jj==wxID_CANCEL) { |
| 92 |
m_returnCode=jj; |
| 93 |
|
| 94 |
+ // mok this seems to be a windows routine |
| 95 |
+ |
| 96 |
+ wxDialog::EndDialog(jj); |
| 97 |
+ |
| 98 |
} |
| 99 |
else if (jj==wxID_OK) { |
| 100 |
m_returnCode=jj; |
| 101 |
|
| 102 |
+ wxDialog::AcceptAndClose(); |
| 103 |
} else { |
| 104 |
if (!eventt.pressButton( jj )) eventt.Enable(); |
| 105 |
} |
| 106 |
@@ -363,7 +366,7 @@ |
| 107 |
|
| 108 |
top->Add( upper, 0, wxALIGN_CENTER|wxALL, 20 ); |
| 109 |
if (mid) top->Add( mid ); |
| 110 |
|
| 111 |
+ top->Add( wxDialog::CreateSeparatedButtonSizer(wxOK|wxCANCEL), 0, wxALIGN_CENTER |wxALL, 20 ); |
| 112 |
SetSizerAndFit(top); |
| 113 |
eventt.Enable(); |
| 114 |
|