diff options
Diffstat (limited to 'src/ui.h')
| -rw-r--r-- | src/ui.h | 417 |
1 files changed, 0 insertions, 417 deletions
diff --git a/src/ui.h b/src/ui.h deleted file mode 100644 index 2efeace..0000000 --- a/src/ui.h +++ /dev/null | |||
| @@ -1,417 +0,0 @@ | |||
| 1 | // Copyright (c) 2009 Satoshi Nakamoto | ||
| 2 | // Distributed under the MIT/X11 software license, see the accompanying | ||
| 3 | // file license.txt or http://www.opensource.org/licenses/mit-license.php. | ||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | DECLARE_EVENT_TYPE(wxEVT_CROSSTHREADCALL, -1) | ||
| 9 | DECLARE_EVENT_TYPE(wxEVT_REPLY1, -1) | ||
| 10 | DECLARE_EVENT_TYPE(wxEVT_REPLY2, -1) | ||
| 11 | DECLARE_EVENT_TYPE(wxEVT_REPLY3, -1) | ||
| 12 | DECLARE_EVENT_TYPE(wxEVT_TABLEADDED, -1) | ||
| 13 | DECLARE_EVENT_TYPE(wxEVT_TABLEUPDATED, -1) | ||
| 14 | DECLARE_EVENT_TYPE(wxEVT_TABLEDELETED, -1) | ||
| 15 | |||
| 16 | enum | ||
| 17 | { | ||
| 18 | UICALL_ADDORDER = 1, | ||
| 19 | UICALL_UPDATEORDER, | ||
| 20 | }; | ||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | extern void HandleCtrlA(wxKeyEvent& event); | ||
| 25 | extern string DateTimeStr(int64 nTime); | ||
| 26 | extern string FormatTxStatus(const CWalletTx& wtx); | ||
| 27 | extern void CrossThreadCall(int nID, void* pdata); | ||
| 28 | extern void MainFrameRepaint(); | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | class CMainFrame : public CMainFrameBase | ||
| 36 | { | ||
| 37 | protected: | ||
| 38 | // Event handlers | ||
| 39 | void OnClose(wxCloseEvent& event); | ||
| 40 | void OnMouseEvents(wxMouseEvent& event); | ||
| 41 | void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); } | ||
| 42 | void OnIdle(wxIdleEvent& event); | ||
| 43 | void OnPaint(wxPaintEvent& event); | ||
| 44 | void OnPaintListCtrl(wxPaintEvent& event); | ||
| 45 | void OnMenuFileExit(wxCommandEvent& event); | ||
| 46 | void OnMenuOptionsGenerate(wxCommandEvent& event); | ||
| 47 | void OnMenuOptionsOptions(wxCommandEvent& event); | ||
| 48 | void OnMenuHelpAbout(wxCommandEvent& event); | ||
| 49 | void OnButtonSend(wxCommandEvent& event); | ||
| 50 | void OnButtonAddressBook(wxCommandEvent& event); | ||
| 51 | void OnSetFocusAddress(wxFocusEvent& event); | ||
| 52 | void OnMouseEventsAddress(wxMouseEvent& event); | ||
| 53 | void OnButtonCopy(wxCommandEvent& event); | ||
| 54 | void OnButtonChange(wxCommandEvent& event); | ||
| 55 | void OnListColBeginDrag(wxListEvent& event); | ||
| 56 | void OnListItemActivatedAllTransactions(wxListEvent& event); | ||
| 57 | void OnListItemActivatedProductsSent(wxListEvent& event); | ||
| 58 | void OnListItemActivatedOrdersSent(wxListEvent& event); | ||
| 59 | void OnListItemActivatedOrdersReceived(wxListEvent& event); | ||
| 60 | |||
| 61 | public: | ||
| 62 | /** Constructor */ | ||
| 63 | CMainFrame(wxWindow* parent); | ||
| 64 | ~CMainFrame(); | ||
| 65 | |||
| 66 | // Custom | ||
| 67 | bool fRefreshListCtrl; | ||
| 68 | bool fRefreshListCtrlRunning; | ||
| 69 | bool fOnSetFocusAddress; | ||
| 70 | CBlockIndex* pindexBestLast; | ||
| 71 | set<uint256> setUnmaturedDisplayed; | ||
| 72 | |||
| 73 | void OnCrossThreadCall(wxCommandEvent& event); | ||
| 74 | void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); | ||
| 75 | void InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1); | ||
| 76 | void RefreshListCtrl(); | ||
| 77 | void RefreshStatus(); | ||
| 78 | }; | ||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | class CTxDetailsDialog : public CTxDetailsDialogBase | ||
| 84 | { | ||
| 85 | protected: | ||
| 86 | // Event handlers | ||
| 87 | void OnButtonOK(wxCommandEvent& event); | ||
| 88 | |||
| 89 | public: | ||
| 90 | /** Constructor */ | ||
| 91 | CTxDetailsDialog(wxWindow* parent, CWalletTx wtx); | ||
| 92 | |||
| 93 | // State | ||
| 94 | CWalletTx wtx; | ||
| 95 | }; | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | class COptionsDialog : public COptionsDialogBase | ||
| 100 | { | ||
| 101 | protected: | ||
| 102 | // Event handlers | ||
| 103 | void OnKillFocusTransactionFee(wxFocusEvent& event); | ||
| 104 | void OnButtonOK(wxCommandEvent& event); | ||
| 105 | void OnButtonCancel(wxCommandEvent& event); | ||
| 106 | |||
| 107 | public: | ||
| 108 | /** Constructor */ | ||
| 109 | COptionsDialog(wxWindow* parent); | ||
| 110 | }; | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | class CAboutDialog : public CAboutDialogBase | ||
| 115 | { | ||
| 116 | protected: | ||
| 117 | // Event handlers | ||
| 118 | void OnButtonOK(wxCommandEvent& event); | ||
| 119 | |||
| 120 | public: | ||
| 121 | /** Constructor */ | ||
| 122 | CAboutDialog(wxWindow* parent); | ||
| 123 | }; | ||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | class CSendDialog : public CSendDialogBase | ||
| 128 | { | ||
| 129 | protected: | ||
| 130 | // Event handlers | ||
| 131 | void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); } | ||
| 132 | void OnTextAddress(wxCommandEvent& event); | ||
| 133 | void OnKillFocusAmount(wxFocusEvent& event); | ||
| 134 | void OnButtonAddressBook(wxCommandEvent& event); | ||
| 135 | void OnButtonPaste(wxCommandEvent& event); | ||
| 136 | void OnButtonSend(wxCommandEvent& event); | ||
| 137 | void OnButtonCancel(wxCommandEvent& event); | ||
| 138 | |||
| 139 | public: | ||
| 140 | /** Constructor */ | ||
| 141 | CSendDialog(wxWindow* parent, const wxString& strAddress=""); | ||
| 142 | }; | ||
| 143 | |||
| 144 | |||
| 145 | |||
| 146 | class CSendingDialog : public CSendingDialogBase | ||
| 147 | { | ||
| 148 | public: | ||
| 149 | // Event handlers | ||
| 150 | void OnClose(wxCloseEvent& event); | ||
| 151 | void OnButtonOK(wxCommandEvent& event); | ||
| 152 | void OnButtonCancel(wxCommandEvent& event); | ||
| 153 | void OnPaint(wxPaintEvent& event); | ||
| 154 | |||
| 155 | public: | ||
| 156 | /** Constructor */ | ||
| 157 | CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 nPriceIn, const CWalletTx& wtxIn); | ||
| 158 | ~CSendingDialog(); | ||
| 159 | |||
| 160 | // State | ||
| 161 | CAddress addr; | ||
| 162 | int64 nPrice; | ||
| 163 | CWalletTx wtx; | ||
| 164 | wxDateTime start; | ||
| 165 | string strStatus; | ||
| 166 | bool fCanCancel; | ||
| 167 | bool fAbort; | ||
| 168 | bool fSuccess; | ||
| 169 | bool fUIDone; | ||
| 170 | bool fWorkDone; | ||
| 171 | |||
| 172 | void Close(); | ||
| 173 | void Repaint(); | ||
| 174 | bool Status(); | ||
| 175 | bool Status(const string& str); | ||
| 176 | bool Error(const string& str); | ||
| 177 | void StartTransfer(); | ||
| 178 | void OnReply2(CDataStream& vRecv); | ||
| 179 | void OnReply3(CDataStream& vRecv); | ||
| 180 | }; | ||
| 181 | |||
| 182 | void SendingDialogStartTransfer(void* parg); | ||
| 183 | void SendingDialogOnReply2(void* parg, CDataStream& vRecv); | ||
| 184 | void SendingDialogOnReply3(void* parg, CDataStream& vRecv); | ||
| 185 | |||
| 186 | |||
| 187 | |||
| 188 | class CYourAddressDialog : public CYourAddressDialogBase | ||
| 189 | { | ||
| 190 | protected: | ||
| 191 | // Event handlers | ||
| 192 | void OnListEndLabelEdit(wxListEvent& event); | ||
| 193 | void OnListItemSelected(wxListEvent& event); | ||
| 194 | void OnListItemActivated(wxListEvent& event); | ||
| 195 | void OnButtonRename(wxCommandEvent& event); | ||
| 196 | void OnButtonNew(wxCommandEvent& event); | ||
| 197 | void OnButtonCopy(wxCommandEvent& event); | ||
| 198 | void OnButtonOK(wxCommandEvent& event); | ||
| 199 | void OnButtonCancel(wxCommandEvent& event); | ||
| 200 | void OnClose(wxCloseEvent& event); | ||
| 201 | |||
| 202 | public: | ||
| 203 | /** Constructor */ | ||
| 204 | CYourAddressDialog(wxWindow* parent); | ||
| 205 | CYourAddressDialog(wxWindow* parent, const string& strInitSelected); | ||
| 206 | |||
| 207 | // Custom | ||
| 208 | wxString GetAddress(); | ||
| 209 | }; | ||
| 210 | |||
| 211 | |||
| 212 | |||
| 213 | class CAddressBookDialog : public CAddressBookDialogBase | ||
| 214 | { | ||
| 215 | protected: | ||
| 216 | // Event handlers | ||
| 217 | void OnListEndLabelEdit(wxListEvent& event); | ||
| 218 | void OnListItemSelected(wxListEvent& event); | ||
| 219 | void OnListItemActivated(wxListEvent& event); | ||
| 220 | void OnButtonEdit(wxCommandEvent& event); | ||
| 221 | void OnButtonDelete(wxCommandEvent& event); | ||
| 222 | void OnButtonNew(wxCommandEvent& event); | ||
| 223 | void OnButtonCopy(wxCommandEvent& event); | ||
| 224 | void OnButtonOK(wxCommandEvent& event); | ||
| 225 | void OnButtonCancel(wxCommandEvent& event); | ||
| 226 | void OnClose(wxCloseEvent& event); | ||
| 227 | |||
| 228 | public: | ||
| 229 | /** Constructor */ | ||
| 230 | CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, bool fSendingIn); | ||
| 231 | |||
| 232 | // Custom | ||
| 233 | bool fSending; | ||
| 234 | wxString GetAddress(); | ||
| 235 | }; | ||
| 236 | |||
| 237 | |||
| 238 | |||
| 239 | class CProductsDialog : public CProductsDialogBase | ||
| 240 | { | ||
| 241 | protected: | ||
| 242 | // Event handlers | ||
| 243 | void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); } | ||
| 244 | void OnCombobox(wxCommandEvent& event); | ||
| 245 | void OnButtonSearch(wxCommandEvent& event); | ||
| 246 | void OnListItemActivated(wxListEvent& event); | ||
| 247 | |||
| 248 | public: | ||
| 249 | /** Constructor */ | ||
| 250 | CProductsDialog(wxWindow* parent); | ||
| 251 | |||
| 252 | // Custom | ||
| 253 | vector<CProduct> m_vProduct; | ||
| 254 | }; | ||
| 255 | |||
| 256 | |||
| 257 | |||
| 258 | class CEditProductDialog : public CEditProductDialogBase | ||
| 259 | { | ||
| 260 | protected: | ||
| 261 | // Event handlers | ||
| 262 | void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); } | ||
| 263 | void OnButtonDel0(wxCommandEvent& event); | ||
| 264 | void OnButtonDel1(wxCommandEvent& event); | ||
| 265 | void OnButtonDel2(wxCommandEvent& event); | ||
| 266 | void OnButtonDel3(wxCommandEvent& event); | ||
| 267 | void OnButtonDel4(wxCommandEvent& event); | ||
| 268 | void OnButtonDel5(wxCommandEvent& event); | ||
| 269 | void OnButtonDel6(wxCommandEvent& event); | ||
| 270 | void OnButtonDel7(wxCommandEvent& event); | ||
| 271 | void OnButtonDel8(wxCommandEvent& event); | ||
| 272 | void OnButtonDel9(wxCommandEvent& event); | ||
| 273 | void OnButtonDel10(wxCommandEvent& event); | ||
| 274 | void OnButtonDel11(wxCommandEvent& event); | ||
| 275 | void OnButtonDel12(wxCommandEvent& event); | ||
| 276 | void OnButtonDel13(wxCommandEvent& event); | ||
| 277 | void OnButtonDel14(wxCommandEvent& event); | ||
| 278 | void OnButtonDel15(wxCommandEvent& event); | ||
| 279 | void OnButtonDel16(wxCommandEvent& event); | ||
| 280 | void OnButtonDel17(wxCommandEvent& event); | ||
| 281 | void OnButtonDel18(wxCommandEvent& event); | ||
| 282 | void OnButtonDel19(wxCommandEvent& event); | ||
| 283 | void OnButtonAddField(wxCommandEvent& event); | ||
| 284 | void OnButtonSend(wxCommandEvent& event); | ||
| 285 | void OnButtonPreview(wxCommandEvent& event); | ||
| 286 | void OnButtonCancel(wxCommandEvent& event); | ||
| 287 | |||
| 288 | public: | ||
| 289 | /** Constructor */ | ||
| 290 | CEditProductDialog(wxWindow* parent); | ||
| 291 | |||
| 292 | // Custom | ||
| 293 | enum { FIELDS_MAX = 20 }; | ||
| 294 | wxTextCtrl* m_textCtrlLabel[FIELDS_MAX]; | ||
| 295 | wxTextCtrl* m_textCtrlField[FIELDS_MAX]; | ||
| 296 | wxButton* m_buttonDel[FIELDS_MAX]; | ||
| 297 | |||
| 298 | void LayoutAll(); | ||
| 299 | void ShowLine(int i, bool fShow=true); | ||
| 300 | void OnButtonDel(wxCommandEvent& event, int n); | ||
| 301 | void SetProduct(const CProduct& productIn); | ||
| 302 | void GetProduct(CProduct& product); | ||
| 303 | |||
| 304 | }; | ||
| 305 | |||
| 306 | |||
| 307 | |||
| 308 | class CViewProductDialog : public CViewProductDialogBase | ||
| 309 | { | ||
| 310 | protected: | ||
| 311 | // Event handlers | ||
| 312 | void OnButtonSubmitForm(wxCommandEvent& event); | ||
| 313 | void OnButtonCancelForm(wxCommandEvent& event); | ||
| 314 | void OnButtonBack(wxCommandEvent& event); | ||
| 315 | void OnButtonNext(wxCommandEvent& event); | ||
| 316 | void OnButtonCancel(wxCommandEvent& event); | ||
| 317 | |||
| 318 | public: | ||
| 319 | /** Constructor */ | ||
| 320 | CViewProductDialog(wxWindow* parent, const CProduct& productIn); | ||
| 321 | ~CViewProductDialog(); | ||
| 322 | |||
| 323 | // Custom | ||
| 324 | CProduct product; | ||
| 325 | enum { FIELDS_MAX = 20 }; | ||
| 326 | wxStaticText* m_staticTextLabel[FIELDS_MAX]; | ||
| 327 | wxTextCtrl* m_textCtrlField[FIELDS_MAX]; | ||
| 328 | wxChoice* m_choiceField[FIELDS_MAX]; | ||
| 329 | |||
| 330 | void GetOrder(CWalletTx& order); | ||
| 331 | void UpdateProductDisplay(bool fDetails); | ||
| 332 | void OnReply1(wxCommandEvent& event); | ||
| 333 | }; | ||
| 334 | |||
| 335 | |||
| 336 | |||
| 337 | class CViewOrderDialog : public CViewOrderDialogBase | ||
| 338 | { | ||
| 339 | protected: | ||
| 340 | // Event handlers | ||
| 341 | void OnButtonOK(wxCommandEvent& event); | ||
| 342 | |||
| 343 | public: | ||
| 344 | /** Constructor */ | ||
| 345 | CViewOrderDialog(wxWindow* parent, CWalletTx order, bool fReceived); | ||
| 346 | |||
| 347 | // Custom | ||
| 348 | bool fReceived; | ||
| 349 | }; | ||
| 350 | |||
| 351 | |||
| 352 | |||
| 353 | class CEditReviewDialog : public CEditReviewDialogBase | ||
| 354 | { | ||
| 355 | protected: | ||
| 356 | // Event handlers | ||
| 357 | void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); } | ||
| 358 | void OnButtonSubmit(wxCommandEvent& event); | ||
| 359 | void OnButtonCancel(wxCommandEvent& event); | ||
| 360 | |||
| 361 | public: | ||
| 362 | /** Constructor */ | ||
| 363 | CEditReviewDialog(wxWindow* parent); | ||
| 364 | |||
| 365 | // Custom | ||
| 366 | void GetReview(CReview& review); | ||
| 367 | }; | ||
| 368 | |||
| 369 | |||
| 370 | |||
| 371 | class CGetTextFromUserDialog : public CGetTextFromUserDialogBase | ||
| 372 | { | ||
| 373 | protected: | ||
| 374 | // Event handlers | ||
| 375 | void OnButtonOK(wxCommandEvent& event) { EndModal(true); } | ||
| 376 | void OnButtonCancel(wxCommandEvent& event) { EndModal(false); } | ||
| 377 | void OnClose(wxCloseEvent& event) { EndModal(false); } | ||
| 378 | |||
| 379 | void OnKeyDown(wxKeyEvent& event) | ||
| 380 | { | ||
| 381 | if (event.GetKeyCode() == '\r' || event.GetKeyCode() == WXK_NUMPAD_ENTER) | ||
| 382 | EndModal(true); | ||
| 383 | else | ||
| 384 | HandleCtrlA(event); | ||
| 385 | } | ||
| 386 | |||
| 387 | public: | ||
| 388 | /** Constructor */ | ||
| 389 | CGetTextFromUserDialog(wxWindow* parent, | ||
| 390 | const string& strCaption, | ||
| 391 | const string& strMessage1, | ||
| 392 | const string& strValue1="", | ||
| 393 | const string& strMessage2="", | ||
| 394 | const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption) | ||
| 395 | { | ||
| 396 | m_staticTextMessage1->SetLabel(strMessage1); | ||
| 397 | m_textCtrl1->SetValue(strValue1); | ||
| 398 | if (!strMessage2.empty()) | ||
| 399 | { | ||
| 400 | m_staticTextMessage2->Show(true); | ||
| 401 | m_staticTextMessage2->SetLabel(strMessage2); | ||
| 402 | m_textCtrl2->Show(true); | ||
| 403 | m_textCtrl2->SetValue(strValue2); | ||
| 404 | SetSize(wxDefaultCoord, 180); | ||
| 405 | } | ||
| 406 | } | ||
| 407 | |||
| 408 | // Custom | ||
| 409 | string GetValue() { return (string)m_textCtrl1->GetValue(); } | ||
| 410 | string GetValue1() { return (string)m_textCtrl1->GetValue(); } | ||
| 411 | string GetValue2() { return (string)m_textCtrl2->GetValue(); } | ||
| 412 | }; | ||
| 413 | |||
| 414 | |||
| 415 | |||
| 416 | |||
| 417 | |||