qspinputdlg.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include "qspinputdlg.h"
  2. QspInputDlg::QspInputDlg(QWidget *parent) :
  3. QWidget(parent)
  4. {
  5. }
  6. QspInputDlg::~QspInputDlg()
  7. {
  8. }
  9. QspInputDlg::QspInputDlg(const QColor &backColor, const QColor &fontColor, const QFont &font, const QString &caption, const QString &text, bool isHtml, const QString &gamePath, QWidget *parent) : QWidget(parent)
  10. {
  11. // // ----------
  12. // SetBackgroundColour(backColor);
  13. // wxSizer *sizerUp = new wxBoxSizer(wxVERTICAL);
  14. // m_desc = new QSPTextBox(this, ID_INPUT_DESC);
  15. // m_desc->SetGamePath(gamePath);
  16. // m_desc->SetIsHtml(isHtml);
  17. // m_desc->SetBackgroundColour(backColor);
  18. // m_desc->SetForegroundColour(fontColor);
  19. // m_desc->SetTextFont(font);
  20. // m_desc->SetText(text);
  21. // wxTextCtrl *inputStr = new wxTextCtrl(this, wxID_ANY);
  22. // inputStr->SetBackgroundColour(backColor);
  23. // inputStr->SetForegroundColour(fontColor);
  24. // inputStr->SetFont(font);
  25. // wxStaticLine* line = new wxStaticLine(this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
  26. // sizerUp->Add(m_desc, 1, wxALL | wxGROW, 2);
  27. // sizerUp->Add(inputStr, 0, wxALL | wxGROW, 2);
  28. // sizerUp->Add(line, 0, wxALL | wxGROW, 2);
  29. // // ----------
  30. // wxSizer *sizerBottom = new wxBoxSizer(wxHORIZONTAL);
  31. // wxButton *btnOk = new wxButton(this, wxID_OK, _("OK"));
  32. // wxButton *btnCancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
  33. // btnOk->SetDefault();
  34. // btnOk->SetFont(font);
  35. // btnCancel->SetFont(font);
  36. // #ifdef __WXMSW__
  37. // btnOk->SetBackgroundColour(backColor);
  38. // btnOk->SetForegroundColour(fontColor);
  39. // btnCancel->SetBackgroundColour(backColor);
  40. // btnCancel->SetForegroundColour(fontColor);
  41. // #endif
  42. // sizerBottom->Add(btnOk, 0, wxALL, 2);
  43. // sizerBottom->Add(btnCancel, 0, wxALL, 2);
  44. // // ----------
  45. // wxSizer *sizerMain = new wxBoxSizer(wxVERTICAL);
  46. // sizerMain->Add(sizerUp, 1, wxGROW, 0);
  47. // sizerMain->Add(sizerBottom, 0, wxALIGN_RIGHT, 0);
  48. // // ----------
  49. // inputStr->SetValidator(wxGenericValidator(&m_text));
  50. // static const int minWidth = 420;
  51. // static const int maxWidth = 550;
  52. // static const int minHeight = 150;
  53. // static const int maxHeight = 350;
  54. // sizerMain->SetMinSize(minWidth, minHeight);
  55. // SetSizerAndFit(sizerMain);
  56. // int deltaH = GetClientSize().GetHeight() - m_desc->GetSize().GetHeight();
  57. // int deltaW = GetClientSize().GetWidth() - m_desc->GetSize().GetWidth();
  58. // int height = m_desc->GetInternalRepresentation()->GetHeight() + m_desc->GetCharHeight() + deltaH;
  59. // int width = m_desc->GetInternalRepresentation()->GetWidth() + deltaW;
  60. // height = wxMin(wxMax(height, minHeight), maxHeight);
  61. // width = wxMin(wxMax(width, minWidth), maxWidth);
  62. // SetClientSize(width, height);
  63. // Center();
  64. // inputStr->SetFocus();
  65. }