diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index b74be7d..b63c030 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -1084,7 +1084,6 @@ long ctlSQLBox::SelectQuery(int startposition) wxChar nextch = GetCharAt(pos); int st = GetStyleAt(pos - 1); int endPos = GetTextLength(); - int match; int pend=endPos; int pstart=0; @@ -1646,8 +1645,8 @@ CharacterRange ctlSQLBox::RegexFindText(int minPos, int maxPos, const wxString & wxWX2MBbuf buf = text.mb_str(wxConvUTF8); ft.lpstrText = (char *)(const char *)buf; -//�� ��������������� � wx 2.8.12 - if (SendMsg(2150, wxSTC_FIND_REGEXP, (long)&ft) == -1) +// + if (SendMsg(2150, wxSTC_FIND_REGEXP, (LONG_PTR)&ft) == -1) { ft.chrgText.cpMin = -1; ft.chrgText.cpMax = -1; diff --git a/ctl/ctlSQLGrid.cpp b/ctl/ctlSQLGrid.cpp index e5b74a2..e62fc0d 100644 --- a/ctl/ctlSQLGrid.cpp +++ b/ctl/ctlSQLGrid.cpp @@ -47,7 +47,7 @@ void ctlSQLGrid::setresizedpi() { SetDefaultCellFont(fntCells); // Set labels font wxFont fntLabel(settings->GetSystemFont()); - fntLabel.SetWeight(wxBOLD); + fntLabel.SetWeight(wxFONTWEIGHT_BOLD); SetLabelFont(fntLabel); SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_TOP); diff --git a/ctl/ctlShortCut.cpp b/ctl/ctlShortCut.cpp index 6ca0640..de2fcab 100644 --- a/ctl/ctlShortCut.cpp +++ b/ctl/ctlShortCut.cpp @@ -1,195 +1,195 @@ -#include "pgAdmin3.h" -#include "ctl/ctlShortCut.h" -#include "frm/frmMain.h" - -ctlShortCut::ctlShortCut(frmMain* main,wxWindow* parent, wxWindowID id, const wxPoint& pos , const wxSize& size ) -{ - wxSize sz(400, -1); - int style = wxCB_SIMPLE| wxTE_PROCESS_ENTER; - - frm = main; - imageList = main->GetImageList(); - //wxComboCtrl* comboCustom = new wxComboCtrl(); - //wxCheckBox* cbox = new wxCheckBox(); - txt = new wxTextCtrl(); - SetMainControl(txt); - Create(parent, id, wxEmptyString, pos, sz, style); - //comboCustom->Create(panel, wxID_ANY, wxEmptyString); - txt->Create(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, style); - txt->SetFont(settings->GetSystemFont()); - //txt->SetBackgroundColour(*wxWHITE); - pop = new wxVListBoxComboPopup(); - ///UseAltPopupWindow(false); - SetPopupControl(pop); - - -// wxArrayString ar; -// ar.Add("100000"); -// ar.Add("200000"); -// ar.Add("300000"); -// this->Append(ar); - txt->Bind(wxEVT_TEXT_ENTER, &ctlShortCut::OnTEXT_ENTER, this); - - txt->Bind(wxEVT_TEXT, &ctlShortCut::OnTEXT, this); - txt->Bind(wxEVT_CHAR, &ctlShortCut::OnCharT, this); - pop->Bind(wxEVT_CHAR, &ctlShortCut::OnChar, this); - Bind(wxEVT_COMBOBOX, &ctlShortCut::OnCombo, this); - - // this->CentreOnParent(); - ; -} -wxTextCtrl* ctlShortCut::GetTextControl() { - return txt; -} -void ctlShortCut::SetText(wxString &str,bool settext) { - if (settext) { - txt->SetValue(str); - } - this->Clear(); - fnd = str; - this->Append(BuildList(str, false)); -} -wxString ctlShortCut::viewText(wxString& s) { - wxString src = s; - src = src.AfterFirst('/').AfterFirst('/'); - src.Replace(_("Schemas"), ""); - src.Replace(_("Tables"), ""); - src.Replace(_("Views"), ""); - src.Replace(_("Functions"), ""); - src.Replace(_("Procedures"), ""); - src.Replace(_("Databases"), ""); - - src.Replace(_("Trigger Functions"), ""); - src.Replace(_("Sequences"), ""); - src.Replace(_("Foreign Tables"), ""); - src.Replace(_("Partitions"), ""); - src.Replace(_("Types"), ""); - src.Replace(_("Triggers"), ""); - src.Replace("//", "/"); - return src; -} -wxArrayString ctlShortCut::BuildList(wxString& find, bool full) { - wxArrayString rez; - if (find.Length()==0) return frm->shortcut; - for (int i = 0; ishortcut.Count(); i++) { - wxString t = viewText(frm->shortcut[i]); - if (t.Find(find) != wxNOT_FOUND) { - if (full) - { - if (find.Length() == t.length()) rez.Add(frm->shortcut[i]); - } - else - rez.Add(frm->shortcut[i]); - - } - } - if (rez.Count() > 0|| full) return rez; - - return frm->shortcut; -} -ctlShortCut::~ctlShortCut() { - //delete txt; - //delete pop; -} - -void ctlShortCut::OnCombo(wxCommandEvent& event) { - // go link - wxString s = GetValue(); - if (s.Length() > 0) frm->select_shortcut = s; - GetParent()->Close(true); - -} -void ctlShortCut::OnTEXT_ENTER(wxCommandEvent& event ) { - - wxString s = txt->GetValue(); - //wxMessageBox("Enter press\n Add link "+s, "Ontext_Enter"); - wxArrayString a=BuildList(s, true); - if (a.Count() > 0) { - // go link - } - else - { - frm->select_shortcut=s; - } - if (s.Length()>0) frm->select_shortcut = '@'+s; - GetParent()->Close(true); -} -void ctlShortCut::OnTEXT(wxCommandEvent& event) { - if (!IsPopupShown() && ( true) ) { - wxString s = txt->GetValue(); - SetText(s,false); - if (pop->GetCount() > 0) { - Popup(); - } - //int e = txt->SetSelection(0, 1); - // - } -} -void ctlShortCut::OnCharT(wxKeyEvent& event) { - if (event.GetKeyCode() == WXK_ESCAPE) { - GetParent()->Close(true); - } - event.Skip(); -} -void ctlShortCut::OnChar(wxKeyEvent& event) { - if (IsPopupShown()) { - wxString s = txt->GetValue(); - wxChar charcode = event.GetUnicodeKey(); - if (event.GetKeyCode() == WXK_BACK) { - txt->EmulateKeyPress(event); - //txt->SetValue(s.Left(s.Length()-1)); - } - if (wxIsprint(charcode)) - { - //txt->EmulateKeyPress(event); - s += charcode; - SetText(s, false); - txt->SetValue(s); - pop->Refresh(); - return; - } - else event.Skip(); - - - } - -event.Skip(); -} -dlgShortCut::dlgShortCut(frmMain* parent, wxWindowID id, wxPoint pos, const wxSize size) - :wxDialog(reinterpret_cast (parent), id, wxEmptyString, pos, size, wxSUNKEN_BORDER | wxSTAY_ON_TOP) -{ - // SetExtraStyle(GetExtraStyle() & ~wxWS_EX_BLOCK_EVENTS); - //this->SetSize(wxSize(243, 165)); - wxBoxSizer* vSizer = new wxBoxSizer(wxVERTICAL); - - ctlShortCut *cb=new ctlShortCut(parent,this, wxID_ANY, wxDefaultPosition, wxDefaultSize); - frm = parent; - wxTreeItemId item = frm->GetBrowser()->GetSelection(); - wxString curparh=frm->GetNodePath(item); - curparh = ""; - cb->SetText(curparh, true); - wxTextCtrl *c=cb->GetTextControl(); - - cb->Bind(wxEVT_KEY_DOWN, &dlgShortCut::OnKEY_DOWN, this); - // Bind(wxEVT_CHAR_HOOK, &dlgShortCut::OnCharHook, this); - - vSizer->Add(cb, 0, wxEXPAND | wxALL, 3); - SetSizerAndFit(vSizer); - //SetSizer(vSizer); -} -dlgShortCut::~dlgShortCut() { - //delete cb; -} -void dlgShortCut::OnCharHook(wxKeyEvent& event) { - - event.Skip(); -} -void dlgShortCut::OnKEY_DOWN(wxKeyEvent& event) { - if (event.GetKeyCode() == WXK_ESCAPE) { - Close(true); - } - if (!cb->HasFocus()) { - - } - event.Skip(); -} +#include "pgAdmin3.h" +#include "ctl/ctlShortCut.h" +#include "frm/frmMain.h" + +ctlShortCut::ctlShortCut(frmMain* main,wxWindow* parent, wxWindowID id, const wxPoint& pos , const wxSize& size ) +{ + wxSize sz(400, -1); + int style = wxCB_SIMPLE| wxTE_PROCESS_ENTER; + + frm = main; + imageList = main->GetImageList(); + //wxComboCtrl* comboCustom = new wxComboCtrl(); + //wxCheckBox* cbox = new wxCheckBox(); + txt = new wxTextCtrl(); + SetMainControl(txt); + Create(parent, id, wxEmptyString, pos, sz, style); + //comboCustom->Create(panel, wxID_ANY, wxEmptyString); + txt->Create(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, style); + txt->SetFont(settings->GetSystemFont()); + //txt->SetBackgroundColour(*wxWHITE); + pop = new wxVListBoxComboPopup(); + ///UseAltPopupWindow(false); + SetPopupControl(pop); + + +// wxArrayString ar; +// ar.Add("100000"); +// ar.Add("200000"); +// ar.Add("300000"); +// this->Append(ar); + txt->Bind(wxEVT_TEXT_ENTER, &ctlShortCut::OnTEXT_ENTER, this); + + txt->Bind(wxEVT_TEXT, &ctlShortCut::OnTEXT, this); + txt->Bind(wxEVT_CHAR, &ctlShortCut::OnCharT, this); + pop->Bind(wxEVT_CHAR, &ctlShortCut::OnChar, this); + Bind(wxEVT_COMBOBOX, &ctlShortCut::OnCombo, this); + + // this->CentreOnParent(); + ; +} +wxTextCtrl* ctlShortCut::GetTextControl() { + return txt; +} +void ctlShortCut::SetText(wxString &str,bool settext) { + if (settext) { + txt->SetValue(str); + } + this->Clear(); + fnd = str; + this->Append(BuildList(str, false)); +} +wxString ctlShortCut::viewText(wxString& s) { + wxString src = s; + src = src.AfterFirst('/').AfterFirst('/'); + src.Replace(_("Schemas"), ""); + src.Replace(_("Tables"), ""); + src.Replace(_("Views"), ""); + src.Replace(_("Functions"), ""); + src.Replace(_("Procedures"), ""); + src.Replace(_("Databases"), ""); + + src.Replace(_("Trigger Functions"), ""); + src.Replace(_("Sequences"), ""); + src.Replace(_("Foreign Tables"), ""); + src.Replace(_("Partitions"), ""); + src.Replace(_("Types"), ""); + src.Replace(_("Triggers"), ""); + src.Replace("//", "/"); + return src; +} +wxArrayString ctlShortCut::BuildList(wxString& find, bool full) { + wxArrayString rez; + if (find.Length()==0) return frm->shortcut; + for (int i = 0; ishortcut.Count(); i++) { + wxString t = viewText(frm->shortcut[i]); + if (t.Find(find) != wxNOT_FOUND) { + if (full) + { + if (find.Length() == t.length()) rez.Add(frm->shortcut[i]); + } + else + rez.Add(frm->shortcut[i]); + + } + } + if (rez.Count() > 0|| full) return rez; + + return frm->shortcut; +} +ctlShortCut::~ctlShortCut() { + //delete txt; + //delete pop; +} + +void ctlShortCut::OnCombo(wxCommandEvent& event) { + // go link + wxString s = GetValue(); + if (s.Length() > 0) frm->select_shortcut = s; + GetParent()->Close(true); + +} +void ctlShortCut::OnTEXT_ENTER(wxCommandEvent& event ) { + + wxString s = txt->GetValue(); + //wxMessageBox("Enter press\n Add link "+s, "Ontext_Enter"); + wxArrayString a=BuildList(s, true); + if (a.Count() > 0) { + // go link + } + else + { + frm->select_shortcut=s; + } + if (s.Length()>0) frm->select_shortcut = '@'+s; + GetParent()->Close(true); +} +void ctlShortCut::OnTEXT(wxCommandEvent& event) { + if (!IsPopupShown() && ( true) ) { + wxString s = txt->GetValue(); + SetText(s,false); + if (pop->GetCount() > 0) { + Popup(); + } + //int e = txt->SetSelection(0, 1); + // + } +} +void ctlShortCut::OnCharT(wxKeyEvent& event) { + if (event.GetKeyCode() == WXK_ESCAPE) { + GetParent()->Close(true); + } + event.Skip(); +} +void ctlShortCut::OnChar(wxKeyEvent& event) { + if (IsPopupShown()) { + wxString s = txt->GetValue(); + wxChar charcode = event.GetUnicodeKey(); + if (event.GetKeyCode() == WXK_BACK) { + txt->EmulateKeyPress(event); + //txt->SetValue(s.Left(s.Length()-1)); + } + if (wxIsprint(charcode)) + { + //txt->EmulateKeyPress(event); + s += charcode; + SetText(s, false); + txt->SetValue(s); + pop->Refresh(); + return; + } + else event.Skip(); + + + } + +event.Skip(); +} +dlgShortCut::dlgShortCut(frmMain* parent, wxWindowID id, wxPoint pos, const wxSize size) + :wxDialog(reinterpret_cast (parent), id, wxEmptyString, pos, size, wxSUNKEN_BORDER | wxSTAY_ON_TOP) +{ + // SetExtraStyle(GetExtraStyle() & ~wxWS_EX_BLOCK_EVENTS); + //this->SetSize(wxSize(243, 165)); + wxBoxSizer* vSizer = new wxBoxSizer(wxVERTICAL); + + ctlShortCut *cb=new ctlShortCut(parent,this, wxID_ANY, wxDefaultPosition, wxDefaultSize); + frm = parent; + wxTreeItemId item = frm->GetBrowser()->GetSelection(); + wxString curparh=frm->GetNodePath(item); + curparh = ""; + cb->SetText(curparh, true); + wxTextCtrl *c=cb->GetTextControl(); + + cb->Bind(wxEVT_KEY_DOWN, &dlgShortCut::OnKEY_DOWN, this); + // Bind(wxEVT_CHAR_HOOK, &dlgShortCut::OnCharHook, this); + + vSizer->Add(cb, 0, wxEXPAND | wxALL, 3); + SetSizerAndFit(vSizer); + //SetSizer(vSizer); +} +dlgShortCut::~dlgShortCut() { + //delete cb; +} +void dlgShortCut::OnCharHook(wxKeyEvent& event) { + + event.Skip(); +} +void dlgShortCut::OnKEY_DOWN(wxKeyEvent& event) { + if (event.GetKeyCode() == WXK_ESCAPE) { + Close(true); + } + if (!cb->HasFocus()) { + + } + event.Skip(); +} diff --git a/ctl/ctlTree.cpp b/ctl/ctlTree.cpp index 0f491f1..1a533fb 100644 --- a/ctl/ctlTree.cpp +++ b/ctl/ctlTree.cpp @@ -191,7 +191,7 @@ void ctlTree::DrawDbName(const wxTreeItemId& item) { if (s) { if (!(s->GetColour().IsEmpty())) { c=s->GetColour(); - dc.SetBrush(wxBrush(c, wxSOLID)); + dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(c)); } else dc.SetBrush(*wxYELLOW_BRUSH); } diff --git a/ctl/explainCanvas.cpp b/ctl/explainCanvas.cpp index 4bd2599..0b34b3e 100644 --- a/ctl/explainCanvas.cpp +++ b/ctl/explainCanvas.cpp @@ -385,7 +385,7 @@ void ExplainText::OnPaint(wxPaintEvent &ev) wxFont stdFont = settings->GetSystemFont(); wxFont boldFont = stdFont; - boldFont.SetWeight(wxBOLD); + boldFont.SetWeight(wxFONTWEIGHT_BOLD); int x = GetCharHeight() / 2; int y = GetCharHeight() / 2; diff --git a/ctl/explainShape.cpp b/ctl/explainShape.cpp index 48a8068..207ec72 100644 --- a/ctl/explainShape.cpp +++ b/ctl/explainShape.cpp @@ -536,8 +536,8 @@ void ExplainLine::OnDraw(wxDC &dc) { if (m_lineControlPoints) { - dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1, wxSOLID)); - dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*wxLIGHT_GREY, wxSOLID)); + dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1, wxPENSTYLE_SOLID)); + dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*wxLIGHT_GREY, wxBRUSHSTYLE_SOLID)); wxPoint *points = new wxPoint[11]; wxRealPoint *point0 = (wxRealPoint *) m_lineControlPoints->Item(0)->GetData(); diff --git a/dlg/dlgMainConfig.cpp b/dlg/dlgMainConfig.cpp index b59301a..5563723 100644 --- a/dlg/dlgMainConfig.cpp +++ b/dlg/dlgMainConfig.cpp @@ -107,7 +107,7 @@ dlgMainConfig::dlgMainConfig(pgFrame *parent, pgSettingItem *_item) : txtComment->SetValue(item->newLine->comment); wxFont fntLabel = stName->GetFont(); - fntLabel.SetWeight(wxBOLD); + fntLabel.SetWeight(wxFONTWEIGHT_BOLD); stName->SetFont(fntLabel); stName->SetLabel(item->name); diff --git a/dlg/dlgProJob.cpp b/dlg/dlgProJob.cpp index 9205cdc..42de4ab 100644 --- a/dlg/dlgProJob.cpp +++ b/dlg/dlgProJob.cpp @@ -181,7 +181,6 @@ void dlgProJob::OnRemove(wxCommandEvent& ev) { void dlgProJob::OnChangeName(wxCommandEvent &ev) { - bool relocatable; // add all versions //cbVersion->Clear(); diff --git a/frm/events.cpp b/frm/events.cpp index efd049c..e7cc8c7 100644 --- a/frm/events.cpp +++ b/frm/events.cpp @@ -862,7 +862,7 @@ void frmMain::OnShortCut(wxCommandEvent& event) bool add = false; if (select_shortcut.IsEmpty()) return; - if (select_shortcut.StartsWith("@") > 0) { + if (select_shortcut.StartsWith("@")) { select_shortcut = select_shortcut.substr(4); path = select_shortcut.SubString(1, select_shortcut.Length() - 1); add = true; diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index 2790619..79f3a3e 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -641,7 +641,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w // btnModeTransaction->Enable(true); wxFont stdFont = settings->GetSystemFont(); wxFont boldFont = stdFont; - boldFont.SetWeight(wxBOLD); + boldFont.SetWeight(wxFONTWEIGHT_BOLD); btnModeTransaction->SetFont(boldFont); if (settings->GetAutoCommit()) btnModeTransaction->SetLabel("A"); diff --git a/frm/frmReport.cpp b/frm/frmReport.cpp index c3ebbcc..c68e8df 100644 --- a/frm/frmReport.cpp +++ b/frm/frmReport.cpp @@ -1286,7 +1286,6 @@ void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayStrin else child = browser->GetFirstChild(node, cookie); pgObject *obj; wxString path; - time_t tmp; int size=expandedNodes.Count(); while (child.IsOk()) { diff --git a/gqb/gqbGridRestTable.cpp b/gqb/gqbGridRestTable.cpp index f086a55..6de2fda 100644 --- a/gqb/gqbGridRestTable.cpp +++ b/gqb/gqbGridRestTable.cpp @@ -223,22 +223,22 @@ void wxGridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC & // Draw 3-d button wxColour colourBackGround = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); - dc.SetBrush(wxBrush(colourBackGround, wxSOLID)); - dc.SetPen(wxPen(colourBackGround, 1, wxSOLID)); + dc.SetBrush(wxBrush(colourBackGround, wxBRUSHSTYLE_SOLID)); + dc.SetPen(wxPen(colourBackGround, 1, wxPENSTYLE_SOLID)); dc.DrawRectangle(rectButton); - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxSOLID)); + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetLeft(), rectButton.GetBottom(), rectButton.GetRight(), rectButton.GetBottom()); dc.DrawLine(rectButton.GetRight(), rectButton.GetBottom(), rectButton.GetRight(), rectButton.GetTop() - 1); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW), - 1, wxSOLID)); + 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetLeft() + 1, rectButton.GetBottom() - 1, rectButton.GetRight() - 1, rectButton.GetBottom() - 1); dc.DrawLine(rectButton.GetRight() - 1, rectButton.GetBottom() - 1, rectButton.GetRight() - 1, rectButton.GetTop()); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT), - 1, wxSOLID)); + 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetRight() - 2, rectButton.GetTop() + 1, rectButton.GetLeft() + 1, rectButton.GetTop() + 1); dc.DrawLine(rectButton.GetLeft() + 1, rectButton.GetTop() + 1, @@ -252,12 +252,12 @@ void wxGridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC & rectButton.GetTop() + (rectButton.GetHeight() - nTriHeight) / 2); point[1] = wxPoint(point[0].x + nTriWidth - 1, point[0].y); point[2] = wxPoint(point[0].x + 3, point[0].y + nTriHeight - 1); - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), wxSOLID)); - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxSOLID)); + dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), wxBRUSHSTYLE_SOLID)); + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxPENSTYLE_SOLID)); dc.DrawPolygon(3, point); if (m_border == wxLAYOUT_TOP) { - dc.SetPen(wxPen(*wxBLACK, 1, wxDOT)); + dc.SetPen(wxPen(*wxBLACK, 1, wxPENSTYLE_DOT)); dc.DrawLine(rectCell.GetRight(), rectCell.GetTop(), rectCell.GetLeft(), rectCell.GetTop()); } @@ -300,30 +300,30 @@ void wxGridCellButtonRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc return; wxColour colourBackGround = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); - dc.SetBrush(wxBrush(colourBackGround, wxSOLID)); - dc.SetPen(wxPen(colourBackGround, 1, wxSOLID)); + dc.SetBrush(wxBrush(colourBackGround, wxBRUSHSTYLE_SOLID)); + dc.SetPen(wxPen(colourBackGround, 1, wxPENSTYLE_SOLID)); dc.DrawRectangle(rectButton); - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxSOLID)); + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetLeft(), rectButton.GetBottom(), rectButton.GetRight(), rectButton.GetBottom()); dc.DrawLine(rectButton.GetRight(), rectButton.GetBottom(), rectButton.GetRight(), rectButton.GetTop() - 1); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW), - 1, wxSOLID)); + 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetLeft() + 1, rectButton.GetBottom() - 1, rectButton.GetRight() - 1, rectButton.GetBottom() - 1); dc.DrawLine(rectButton.GetRight() - 1, rectButton.GetBottom() - 1, rectButton.GetRight() - 1, rectButton.GetTop()); dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT), - 1, wxSOLID)); + 1, wxPENSTYLE_SOLID)); dc.DrawLine(rectButton.GetRight() - 2, rectButton.GetTop() + 1, rectButton.GetLeft() + 1, rectButton.GetTop() + 1); dc.DrawLine(rectButton.GetLeft() + 1, rectButton.GetTop() + 1, rectButton.GetLeft() + 1, rectButton.GetBottom() - 1); // Draw little plus symbol - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), wxSOLID)); - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxSOLID)); + dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), wxBRUSHSTYLE_SOLID)); + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT), 1, wxPENSTYLE_SOLID)); int nPlusWidth = 7; int nPlusHeight = 7; wxPoint point[4]; @@ -336,7 +336,7 @@ void wxGridCellButtonRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc if (m_border == wxLAYOUT_TOP) { - dc.SetPen(wxPen(*wxBLACK, 1, wxDOT)); + dc.SetPen(wxPen(*wxBLACK, 1, wxPENSTYLE_DOT)); dc.DrawLine(rectCell.GetRight(), rectCell.GetTop(), rectCell.GetLeft(), rectCell.GetTop()); } diff --git a/include/ctl/ctlSQLGrid.h b/include/ctl/ctlSQLGrid.h index b233928..2fa56f6 100644 --- a/include/ctl/ctlSQLGrid.h +++ b/include/ctl/ctlSQLGrid.h @@ -14,7 +14,7 @@ // wxWindows headers #include - +#include class GroupRows; class ctlSQLGrid : public wxGrid @@ -221,23 +221,23 @@ class CursorCellRenderer : public wxGridCellStringRenderer clr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW); - dc.SetBrush( wxBrush(clr, wxSOLID) ); + dc.SetBrush( *wxTheBrushList->FindOrCreateBrush(clr)); } else { wxColor color; color.Set(239, 228, 176); if (sPos = text.Find(wxT('\n')) != wxNOT_FOUND) { - dc.SetBrush(wxBrush(color, wxSOLID)); + dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(color)); multiline = true; } else - dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) ); + dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(attr.GetBackgroundColour())); } } else { - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID)); + dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))); } dc.SetPen( *wxTRANSPARENT_PEN ); diff --git a/include/ctl/ctlShortCut.h b/include/ctl/ctlShortCut.h index 6102576..06de736 100644 --- a/include/ctl/ctlShortCut.h +++ b/include/ctl/ctlShortCut.h @@ -1,111 +1,111 @@ -#ifndef CTLSHORTCUT_H -#define CTLSHORTCUT_H - -#include "pgAdmin3.h" - -#include -class ctlShortCut : public wxOwnerDrawnComboBox -{ -public: - ctlShortCut(frmMain* main,wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); - ~ctlShortCut(); - void OnTEXT_ENTER(wxCommandEvent& event); - void OnCombo(wxCommandEvent& event); - void OnTEXT(wxCommandEvent& event); - void OnChar(wxKeyEvent& event); - void OnCharT(wxKeyEvent& event); - void SetText(wxString& str, bool settext); - wxTextCtrl* GetTextControl(); - static wxString viewText(wxString& src); - wxArrayString BuildList(wxString& find,bool full); - wxTextCtrl* txt; - wxString fnd; - wxVListBoxComboPopup* pop; - frmMain* frm; - wxImageList* imageList; - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const - { - if (item == wxNOT_FOUND) return; - wxCoord w1, h1, w2, h2; - wxString ss = GetString(item); - wxString src = viewText(ss); - int pp = src.Find(fnd); - wxRect r; - - int idx=0; - wxString si = ss.substr(0, 4).Trim(); - if (si.ToInt(&idx)) { - dc.DrawBitmap(imageList->GetBitmap(idx),wxPoint(rect.x,rect.y)); - } - ; - r.x = rect.x+24; - r.y = rect.y + (rect.height / 2) - (dc.GetCharHeight() / 2); - if (pp >= 0) { - dc.SetBrush(*wxYELLOW_BRUSH); - const wxString& line = src; - pp = line.Find(fnd); - - int lineWidth, lineWidthP, lineHeight, start = 0; - wxString pref; - pref = line.substr(start, pp); - - dc.GetTextExtent(pref, &lineWidthP, &lineHeight); - r.x = r.x + lineWidthP+3; - pref = line.substr(pp, fnd.Len()); - dc.GetTextExtent(pref, &lineWidth, &lineHeight); - r.width = lineWidth; - r.height = lineHeight; - dc.DrawRoundedRectangle(r, 3); - } - dc.GetTextExtent(src, &w1, &h1); - dc.DrawText(src, - rect.x + 3+24, - (rect.y + 0) + (rect.height / 2) - (dc.GetCharHeight() / 2) - ); - //dc.SetFont(m_fontList[item]); - } - - virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const - { - // If item is selected or even, or we are painting the - // combo control itself, use the default rendering. - if ((flags & (wxODCB_PAINTING_CONTROL | wxODCB_PAINTING_SELECTED)) || - (item & 1) == 0) - { - wxOwnerDrawnComboBox::OnDrawBackground(dc, rect, item, flags); - return; - } - // Otherwise, draw every other background with different colour. - wxColour bgCol(245, 245, 255); - dc.SetBrush(wxBrush(bgCol)); - dc.SetPen(wxPen(bgCol)); - dc.DrawRectangle(rect); - } - - virtual wxCoord OnMeasureItem(size_t item) const - { - return 20; - } - - virtual wxCoord OnMeasureItemWidth(size_t item) const - { - return 400; - } -}; -class dlgShortCut : public wxDialog -{ -public: - dlgShortCut(frmMain* parent, wxWindowID id, wxPoint pos, const wxSize size); - ~dlgShortCut(); - void OnKEY_DOWN(wxKeyEvent& event); - void OnCharHook(wxKeyEvent& event); - //void OnPopUpOKClick(wxCommandEvent& event); - //void focus(); - -private: - ctlShortCut *cb; - frmMain* frm; -}; - -#endif - +#ifndef CTLSHORTCUT_H +#define CTLSHORTCUT_H + +#include "pgAdmin3.h" + +#include +class ctlShortCut : public wxOwnerDrawnComboBox +{ +public: + ctlShortCut(frmMain* main,wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); + ~ctlShortCut(); + void OnTEXT_ENTER(wxCommandEvent& event); + void OnCombo(wxCommandEvent& event); + void OnTEXT(wxCommandEvent& event); + void OnChar(wxKeyEvent& event); + void OnCharT(wxKeyEvent& event); + void SetText(wxString& str, bool settext); + wxTextCtrl* GetTextControl(); + static wxString viewText(wxString& src); + wxArrayString BuildList(wxString& find,bool full); + wxTextCtrl* txt; + wxString fnd; + wxVListBoxComboPopup* pop; + frmMain* frm; + wxImageList* imageList; + virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const + { + if (item == wxNOT_FOUND) return; + wxCoord w1, h1; + wxString ss = GetString(item); + wxString src = viewText(ss); + int pp = src.Find(fnd); + wxRect r; + + int idx=0; + wxString si = ss.substr(0, 4).Trim(); + if (si.ToInt(&idx)) { + dc.DrawBitmap(imageList->GetBitmap(idx),wxPoint(rect.x,rect.y)); + } + ; + r.x = rect.x+24; + r.y = rect.y + (rect.height / 2) - (dc.GetCharHeight() / 2); + if (pp >= 0) { + dc.SetBrush(*wxYELLOW_BRUSH); + const wxString& line = src; + pp = line.Find(fnd); + + int lineWidth, lineWidthP, lineHeight, start = 0; + wxString pref; + pref = line.substr(start, pp); + + dc.GetTextExtent(pref, &lineWidthP, &lineHeight); + r.x = r.x + lineWidthP+3; + pref = line.substr(pp, fnd.Len()); + dc.GetTextExtent(pref, &lineWidth, &lineHeight); + r.width = lineWidth; + r.height = lineHeight; + dc.DrawRoundedRectangle(r, 3); + } + dc.GetTextExtent(src, &w1, &h1); + dc.DrawText(src, + rect.x + 3+24, + (rect.y + 0) + (rect.height / 2) - (dc.GetCharHeight() / 2) + ); + //dc.SetFont(m_fontList[item]); + } + + virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const + { + // If item is selected or even, or we are painting the + // combo control itself, use the default rendering. + if ((flags & (wxODCB_PAINTING_CONTROL | wxODCB_PAINTING_SELECTED)) || + (item & 1) == 0) + { + wxOwnerDrawnComboBox::OnDrawBackground(dc, rect, item, flags); + return; + } + // Otherwise, draw every other background with different colour. + wxColour bgCol(245, 245, 255); + dc.SetBrush(wxBrush(bgCol)); + dc.SetPen(wxPen(bgCol)); + dc.DrawRectangle(rect); + } + + virtual wxCoord OnMeasureItem(size_t item) const + { + return 20; + } + + virtual wxCoord OnMeasureItemWidth(size_t item) const + { + return 400; + } +}; +class dlgShortCut : public wxDialog +{ +public: + dlgShortCut(frmMain* parent, wxWindowID id, wxPoint pos, const wxSize size); + ~dlgShortCut(); + void OnKEY_DOWN(wxKeyEvent& event); + void OnCharHook(wxKeyEvent& event); + //void OnPopUpOKClick(wxCommandEvent& event); + //void focus(); + +private: + ctlShortCut *cb; + frmMain* frm; +}; + +#endif + diff --git a/ogl/basic.cpp b/ogl/basic.cpp index d4ef7cd..7894565 100644 --- a/ogl/basic.cpp +++ b/ogl/basic.cpp @@ -1240,7 +1240,7 @@ void wxShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush(* wxTRANSPARENT_BRUSH); @@ -1282,7 +1282,7 @@ void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment) // m_xpos = xx; m_ypos = yy; dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -3199,7 +3199,7 @@ wxPen wxShape::GetBackgroundPen() if (GetCanvas()) { wxColour c = GetCanvas()->GetBackgroundColour(); - return wxPen(c, 1, wxSOLID); + return wxPen(c, 1, wxPENSTYLE_SOLID); } return * g_oglWhiteBackgroundPen; } @@ -3210,7 +3210,7 @@ wxBrush wxShape::GetBackgroundBrush() if (GetCanvas()) { wxColour c = GetCanvas()->GetBackgroundColour(); - return wxBrush(c, wxSOLID); + return wxBrush(c, wxBRUSHSTYLE_SOLID); } return * g_oglWhiteBackgroundBrush; } diff --git a/ogl/basic2.cpp b/ogl/basic2.cpp index 78d0541..e06a4d1 100644 --- a/ogl/basic2.cpp +++ b/ogl/basic2.cpp @@ -1284,7 +1284,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint *pt, bool WXUNUSED(draw), double x dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1418,7 +1418,7 @@ void wxShape::OnSizingBeginDragLeft(wxControlPoint *pt, double x, double y, int pt->sm_controlPointDragStartWidth = bound_x; pt->sm_controlPointDragStartHeight = bound_y; - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1610,7 +1610,7 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint *pt, bool WXUNUSED(draw), d dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1662,7 +1662,7 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint *pt, double x, double if (ppt->m_originalDistance == 0.0) ppt->m_originalDistance = (double) 0.0001; - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1746,7 +1746,7 @@ wxShapeRegion::wxShapeRegion() m_regionName = wxEmptyString; m_textColour = wxT("BLACK"); m_penColour = wxT("BLACK"); - m_penStyle = wxSOLID; + m_penStyle = wxPENSTYLE_SOLID; m_actualPenObject = NULL; } @@ -1873,7 +1873,7 @@ wxPen *wxShapeRegion::GetActualPen() if (!m_penColour) return NULL; if (m_penColour == wxT("Invisible")) return NULL; - m_actualPenObject = wxThePenList->FindOrCreatePen(m_penColour, 1, m_penStyle); + m_actualPenObject = wxThePenList->FindOrCreatePen(m_penColour, 1, (wxPenStyle) m_penStyle); return m_actualPenObject; } diff --git a/ogl/canvas.cpp b/ogl/canvas.cpp index 0ca8f59..8e11d7f 100644 --- a/ogl/canvas.cpp +++ b/ogl/canvas.cpp @@ -111,7 +111,7 @@ void wxShapeCanvas::OnPaint(wxPaintEvent &WXUNUSED(event)) // Draws the background void wxShapeCanvas::DrawBackground(wxDC &dc, bool transformed) { - dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); + dc.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID)); dc.Clear(); } diff --git a/ogl/composit.cpp b/ogl/composit.cpp index 6205d36..1ad133a 100644 --- a/ogl/composit.cpp +++ b/ogl/composit.cpp @@ -136,7 +136,7 @@ void wxCompositeShape::OnDragLeft(bool WXUNUSED(draw), double x, double y, int W GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -156,7 +156,7 @@ void wxCompositeShape::OnBeginDragLeft(double x, double y, int WXUNUSED(keys), i dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); m_canvas->CaptureMouse(); @@ -334,7 +334,7 @@ void wxCompositeShape::Copy(wxShape ©) wxCompositeShape &compositeCopy = (wxCompositeShape &) copy; // Associate old and new copies for compositeCopying constraints and division geometry - oglObjectCopyMapping.Append((long)this, &compositeCopy); + oglObjectCopyMapping.Append((LONG_PTR)this, &compositeCopy); // Copy the children wxNode *node = m_children.GetFirst(); @@ -352,7 +352,7 @@ void wxCompositeShape::Copy(wxShape ©) if (m_divisions.Member(object)) compositeCopy.m_divisions.Append(newObject); - oglObjectCopyMapping.Append((long)object, newObject); + oglObjectCopyMapping.Append((LONG_PTR)object, newObject); node = node->GetNext(); } @@ -363,14 +363,14 @@ void wxCompositeShape::Copy(wxShape ©) { wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); - wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->GetData()); + wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((LONG_PTR)constraint->m_constrainingObject)->GetData()); wxList newConstrainedList; wxNode *node2 = constraint->m_constrainedObjects.GetFirst(); while (node2) { wxShape *constrainedObject = (wxShape *)node2->GetData(); - wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData()); + wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((LONG_PTR)constrainedObject)->GetData()); newConstrainedList.Append(newConstrained); node2 = node2->GetNext(); } @@ -393,19 +393,19 @@ void wxCompositeShape::Copy(wxShape ©) while (node) { wxDivisionShape *division = (wxDivisionShape *)node->GetData(); - wxNode *node1 = oglObjectCopyMapping.Find((long)division); + wxNode *node1 = oglObjectCopyMapping.Find((LONG_PTR)division); wxNode *leftNode = NULL; wxNode *topNode = NULL; wxNode *rightNode = NULL; wxNode *bottomNode = NULL; if (division->GetLeftSide()) - leftNode = oglObjectCopyMapping.Find((long)division->GetLeftSide()); + leftNode = oglObjectCopyMapping.Find((LONG_PTR)division->GetLeftSide()); if (division->GetTopSide()) - topNode = oglObjectCopyMapping.Find((long)division->GetTopSide()); + topNode = oglObjectCopyMapping.Find((LONG_PTR)division->GetTopSide()); if (division->GetRightSide()) - rightNode = oglObjectCopyMapping.Find((long)division->GetRightSide()); + rightNode = oglObjectCopyMapping.Find((LONG_PTR)division->GetRightSide()); if (division->GetBottomSide()) - bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide()); + bottomNode = oglObjectCopyMapping.Find((LONG_PTR)division->GetBottomSide()); if (node1) { wxDivisionShape *newDivision = (wxDivisionShape *)node1->GetData(); @@ -1728,8 +1728,8 @@ void wxDivisionShape::PopupMenu(double x, double y) wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); - int mouse_x = (int)(dc.LogicalToDeviceX((long)(x - x1 * unit_x))); - int mouse_y = (int)(dc.LogicalToDeviceY((long)(y - y1 * unit_y))); + int mouse_x = (int)(dc.LogicalToDeviceX((LONG_PTR)(x - x1 * unit_x))); + int mouse_y = (int)(dc.LogicalToDeviceY((LONG_PTR)(y - y1 * unit_y))); m_canvas->PopupMenu(oglPopupDivisionMenu, mouse_x, mouse_y); delete oglPopupDivisionMenu; diff --git a/ogl/divided.cpp b/ogl/divided.cpp index a141cee..bd2e57d 100644 --- a/ogl/divided.cpp +++ b/ogl/divided.cpp @@ -583,7 +583,7 @@ void wxDividedShapeControlPoint::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -602,7 +602,7 @@ void wxDividedShapeControlPoint::OnBeginDragLeft(double WXUNUSED(x), double y, i wxDividedShape *dividedObject = (wxDividedShape *)m_shape; dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); diff --git a/ogl/drawn.cpp b/ogl/drawn.cpp index db239c0..646744a 100644 --- a/ogl/drawn.cpp +++ b/ogl/drawn.cpp @@ -446,7 +446,7 @@ void wxOpSetGDI::Do(wxDC &dc, double WXUNUSED(xoffset), double WXUNUSED(yoffset) // Need to construct a brush to match the outline pen's colour if (m_image->m_outlinePen) { - wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID); + wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxBRUSHSTYLE_SOLID); if (br) dc.SetBrush(* br); } diff --git a/ogl/lines.cpp b/ogl/lines.cpp index a13a0c6..1240489 100644 --- a/ogl/lines.cpp +++ b/ogl/lines.cpp @@ -919,7 +919,7 @@ void wxLineShape::OnDrawOutline(wxDC &dc, double WXUNUSED(x), double WXUNUSED(y) wxPen *old_pen = m_pen; wxBrush *old_brush = m_brush; - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); SetPen(& dottedPen); SetBrush( (wxBrush *) wxTRANSPARENT_BRUSH ); @@ -1152,10 +1152,10 @@ void wxLineShape::OnDraw(wxDC &dc) // Problem with pen - if not a solid pen, does strange things // to the arrowhead. So make (get) a new pen that's solid. - if (m_pen && (m_pen->GetStyle() != wxSOLID)) + if (m_pen && (m_pen->GetStyle() != wxPENSTYLE_DOT)) { wxPen *solid_pen = - wxThePenList->FindOrCreatePen(m_pen->GetColour(), 1, wxSOLID); + wxThePenList->FindOrCreatePen(m_pen->GetColour(), 1, wxPENSTYLE_DOT); if (solid_pen) dc.SetPen(* solid_pen); } @@ -2392,7 +2392,7 @@ wxLabelShape::wxLabelShape(wxLineShape *parent, wxShapeRegion *region, double w, { m_lineShape = parent; m_shapeRegion = region; - SetPen(wxThePenList->FindOrCreatePen(wxColour(0, 0, 0), 1, wxDOT)); + SetPen(wxThePenList->FindOrCreatePen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT)); } wxLabelShape::~wxLabelShape() diff --git a/ogl/mfutils.cpp b/ogl/mfutils.cpp index 81ca969..6f25709 100644 --- a/ogl/mfutils.cpp +++ b/ogl/mfutils.cpp @@ -527,14 +527,14 @@ bool wxXMetaFile::ReadFile(const wxChar *file) getshort(handle); // Y: 2 bytes long colorref = getint(handle); // COLORREF 4 bytes - int style; + wxPenStyle style; if (msStyle == PS_DOT) - style = wxDOT; + style = wxPENSTYLE_DOT; else if (msStyle == PS_DASH) - style = wxSHORT_DASH; + style = wxPENSTYLE_SHORT_DASH; else if (msStyle == PS_NULL) - style = wxTRANSPARENT; - else style = wxSOLID; + style = wxPENSTYLE_TRANSPARENT; + else style = wxPENSTYLE_SOLID; wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref)); rec->param1 = (long)wxThePenList->FindOrCreatePen(colour, x, style); @@ -582,34 +582,34 @@ bool wxXMetaFile::ReadFile(const wxChar *file) // header) fread((void *)lfFacename, sizeof(char), (int)((2 * rdSize) - 18 - 6), handle); - int family; + wxFontFamily family; if (lfPitchAndFamily & FF_MODERN) - family = wxMODERN; + family = wxFONTFAMILY_MODERN; else if (lfPitchAndFamily & FF_MODERN) - family = wxMODERN; + family = wxFONTFAMILY_MODERN; else if (lfPitchAndFamily & FF_ROMAN) - family = wxROMAN; + family = wxFONTFAMILY_ROMAN; else if (lfPitchAndFamily & FF_SWISS) - family = wxSWISS; + family = wxFONTFAMILY_SWISS; else if (lfPitchAndFamily & FF_DECORATIVE) - family = wxDECORATIVE; + family = wxFONTFAMILY_DECORATIVE; else - family = wxDEFAULT; + family = wxFONTFAMILY_DEFAULT; - int weight; + wxFontWeight weight; if (lfWeight == 300) - weight = wxLIGHT; + weight = wxFONTWEIGHT_LIGHT; else if (lfWeight == 400) - weight = wxNORMAL; + weight = wxFONTWEIGHT_NORMAL; else if (lfWeight == 900) - weight = wxBOLD; - else weight = wxNORMAL; + weight = wxFONTWEIGHT_BOLD; + else weight = wxFONTWEIGHT_NORMAL; - int style; + wxFontStyle style; if (lfItalic != 0) - style = wxITALIC; + style = wxFONTSTYLE_ITALIC; else - style = wxNORMAL; + style = wxFONTSTYLE_NORMAL; // About how many pixels per inch??? int logPixelsY = 100; @@ -663,16 +663,16 @@ bool wxXMetaFile::ReadFile(const wxChar *file) } case BS_SOLID: default: - style = wxSOLID; + style = wxBRUSHSTYLE_SOLID; break; } if (msStyle == PS_DOT) - style = wxDOT; + style = wxPENSTYLE_DOT; else if (msStyle == PS_DASH) - style = wxSHORT_DASH; + style = wxPENSTYLE_SHORT_DASH; else if (msStyle == PS_NULL) - style = wxTRANSPARENT; - else style = wxSOLID; + style = wxPENSTYLE_TRANSPARENT; + else style = wxPENSTYLE_SOLID; wxColour colour(GetRValue(colorref), GetGValue(colorref), GetBValue(colorref)); rec->param1 = (long)wxTheBrushList->FindOrCreateBrush(colour, style); diff --git a/ogl/ogldiag.cpp b/ogl/ogldiag.cpp index 6719469..e7cecc1 100644 --- a/ogl/ogldiag.cpp +++ b/ogl/ogldiag.cpp @@ -164,7 +164,7 @@ void wxDiagram::ShowAll(bool show) void wxDiagram::DrawOutline(wxDC &dc, double x1, double y1, double x2, double y2) { - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(wxColour(0, 0, 0), 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); diff --git a/ogl/oglmisc.cpp b/ogl/oglmisc.cpp index fa932bd..b8e429e 100644 --- a/ogl/oglmisc.cpp +++ b/ogl/oglmisc.cpp @@ -37,14 +37,14 @@ void wxOGLInitialize() { g_oglBullseyeCursor = new wxCursor(wxCURSOR_BULLSEYE); - g_oglNormalFont = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL); + g_oglNormalFont = new wxFont(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); - g_oglBlackPen = new wxPen(wxT("BLACK"), 1, wxSOLID); + g_oglBlackPen = new wxPen(wxT("BLACK"), 1, wxPENSTYLE_SOLID); - g_oglWhiteBackgroundPen = new wxPen(wxT("WHITE"), 1, wxSOLID); - g_oglTransparentPen = new wxPen(wxT("WHITE"), 1, wxTRANSPARENT); - g_oglWhiteBackgroundBrush = new wxBrush(wxT("WHITE"), wxSOLID); - g_oglBlackForegroundPen = new wxPen(wxT("BLACK"), 1, wxSOLID); + g_oglWhiteBackgroundPen = new wxPen(wxT("WHITE"), 1, wxPENSTYLE_SOLID); + g_oglTransparentPen = new wxPen(wxT("WHITE"), 1, wxPENSTYLE_TRANSPARENT); + g_oglWhiteBackgroundBrush = new wxBrush(wxT("WHITE"), wxBRUSHSTYLE_SOLID); + g_oglBlackForegroundPen = new wxPen(wxT("BLACK"), 1, wxPENSTYLE_SOLID); OGLInitializeConstraintTypes(); @@ -104,7 +104,7 @@ void wxOGLCleanUp() wxFont *oglMatchFont(int point_size) { - wxFont *font = wxTheFontList->FindOrCreateFont(point_size, wxSWISS, wxNORMAL, wxNORMAL); + wxFont *font = wxTheFontList->FindOrCreateFont(point_size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); #if 0 switch (point_size) { diff --git a/utils/sysSettings.cpp b/utils/sysSettings.cpp index f7cdf9b..ab59629 100644 --- a/utils/sysSettings.cpp +++ b/utils/sysSettings.cpp @@ -691,7 +691,7 @@ wxFont sysSettings::GetSQLFont() if (fontName.IsEmpty()) { #ifdef __WXMSW__ - return wxFont(9, wxTELETYPE, wxNORMAL, wxNORMAL); + return wxFont(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); #else #ifdef __WXGTK__ return wxFont(10, wxTELETYPE, wxNORMAL, wxNORMAL);