X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/41a852156fab5ee6075b3ab92f8230989547daac..8ca1a013e4e699724040ff1f514dab3b4a11d3c9:/src/richtext/richtextsymboldlg.cpp diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index aa9f9fc5ff..13d7834e59 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -120,7 +120,7 @@ static struct { int m_low, m_high; wxUnicodeSubsetCodes m_subset; - wxChar* m_name; + const wxChar* m_name; } g_UnicodeSubsetTable[] = { { 0x0000, 0x007E, @@ -302,13 +302,7 @@ BEGIN_EVENT_TABLE( wxSymbolPickerDialog, wxDialog ) EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_FROM, wxSymbolPickerDialog::OnFromUnicodeSelected ) #endif -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) -#endif - -#if defined(__WXMAC__) - EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) -#endif ////@end wxSymbolPickerDialog event table entries @@ -397,7 +391,7 @@ void wxSymbolPickerDialog::CreateControls() itemBoxSizer4->Add(itemBoxSizer5, 1, wxGROW, 5); wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxString* m_fontCtrlStrings = NULL; m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, wxEmptyString, wxDefaultPosition, wxSize(240, -1), 0, m_fontCtrlStrings, wxCB_READONLY ); @@ -410,7 +404,7 @@ void wxSymbolPickerDialog::CreateControls() #if defined(__UNICODE__) wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Subset:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer5->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif @@ -431,12 +425,12 @@ void wxSymbolPickerDialog::CreateControls() itemBoxSizer3->Add(itemBoxSizer12, 0, wxGROW, 5); m_symbolStaticCtrl = new wxStaticText( itemDialog1, wxID_STATIC, _("xxxx"), wxDefaultPosition, wxSize(40, -1), wxALIGN_CENTRE ); - itemBoxSizer12->Add(m_symbolStaticCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer12->Add(m_symbolStaticCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer12->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, wxEmptyString, wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); m_characterCodeCtrl->SetHelpText(_("The character code.")); @@ -448,7 +442,7 @@ void wxSymbolPickerDialog::CreateControls() #if defined(__UNICODE__) wxStaticText* itemStaticText18 = new wxStaticText( itemDialog1, wxID_STATIC, _("&From:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer12->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif @@ -466,7 +460,7 @@ void wxSymbolPickerDialog::CreateControls() #endif -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) +#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer3->Add(itemBoxSizer20, 0, wxGROW, 5); @@ -838,7 +832,7 @@ bool wxSymbolListCtrl::DoSetCurrent(int current) } if ( m_current != wxNOT_FOUND ) - RefreshLine(SymbolValueToLineNumber(m_current)); + RefreshRow(SymbolValueToLineNumber(m_current)); m_current = current; @@ -850,19 +844,19 @@ bool wxSymbolListCtrl::DoSetCurrent(int current) // don't need to refresh it -- it will be redrawn anyhow if ( !IsVisible(lineNo) ) { - ScrollToLine(lineNo); + ScrollToRow(lineNo); } else // line is at least partly visible { // it is, indeed, only partly visible, so scroll it into view to // make it entirely visible - while ( unsigned(lineNo) == GetLastVisibleLine() && - ScrollToLine(GetVisibleBegin()+1) ) + while ( (unsigned)lineNo + 1 == GetVisibleEnd() && + ScrollToRow(GetVisibleBegin() + 1) ) ; // but in any case refresh it as even if it was only partly visible // before we need to redraw it entirely as its background changed - RefreshLine(lineNo); + RefreshRow(lineNo); } } @@ -910,7 +904,7 @@ void wxSymbolListCtrl::SetSelectionBackground(const wxColour& col) // wxSymbolListCtrl painting // ---------------------------------------------------------------------------- -wxCoord wxSymbolListCtrl::OnGetLineHeight(size_t WXUNUSED(line)) const +wxCoord wxSymbolListCtrl::OnGetRowHeight(size_t WXUNUSED(line)) const { return m_cellSize.y + 2*m_ptMargins.y + 1 /* for divider */ ; } @@ -991,8 +985,8 @@ void wxSymbolListCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.SetFont(GetFont()); // the bounding rectangle of the current line - wxRect rectLine; - rectLine.width = clientSize.x; + wxRect rectRow; + rectRow.width = clientSize.x; dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT))); dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); @@ -1000,25 +994,25 @@ void wxSymbolListCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) // iterate over all visible lines const size_t lineMax = GetVisibleEnd(); - for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ ) + for ( size_t line = GetVisibleBegin(); line < lineMax; line++ ) { - const wxCoord hLine = OnGetLineHeight(line); + const wxCoord hRow = OnGetRowHeight(line); - rectLine.height = hLine; + rectRow.height = hRow; // and draw the ones which intersect the update rect - if ( rectLine.Intersects(rectUpdate) ) + if ( rectRow.Intersects(rectUpdate) ) { // don't allow drawing outside of the lines rectangle - wxDCClipper clip(dc, rectLine); + wxDCClipper clip(dc, rectRow); - wxRect rect = rectLine; + wxRect rect = rectRow; rect.Deflate(m_ptMargins.x, m_ptMargins.y); OnDrawItem(dc, rect, line); } else // no intersection { - if ( rectLine.GetTop() > rectUpdate.GetBottom() ) + if ( rectRow.GetTop() > rectUpdate.GetBottom() ) { // we are already below the update rect, no need to continue // further @@ -1027,7 +1021,7 @@ void wxSymbolListCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) //else: the next line may intersect the update rect } - rectLine.y += hLine; + rectRow.y += hRow; } } @@ -1206,12 +1200,12 @@ void wxSymbolListCtrl::SetupCtrl(bool scrollToSelection) m_symbolsPerLine = sz.x/(m_cellSize.x+m_ptMargins.x); int noLines = (1 + SymbolValueToLineNumber(m_maxSymbolValue)); - SetLineCount(noLines); + SetRowCount(noLines); Refresh(); if (scrollToSelection && m_current != wxNOT_FOUND && m_current >= m_minSymbolValue && m_current <= m_maxSymbolValue) { - ScrollToLine(SymbolValueToLineNumber(m_current)); + ScrollToRow(SymbolValueToLineNumber(m_current)); } } @@ -1220,7 +1214,7 @@ void wxSymbolListCtrl::EnsureVisible(int item) { if (item != wxNOT_FOUND && item >= m_minSymbolValue && item <= m_maxSymbolValue) { - ScrollToLine(SymbolValueToLineNumber(item)); + ScrollToRow(SymbolValueToLineNumber(item)); } } @@ -1228,7 +1222,7 @@ void wxSymbolListCtrl::EnsureVisible(int item) // hit testing int wxSymbolListCtrl::HitTest(const wxPoint& pt) { - wxCoord lineHeight = OnGetLineHeight(0); + wxCoord lineHeight = OnGetRowHeight(0); int atLine = GetVisibleBegin() + (pt.y/lineHeight); int symbol = (atLine*m_symbolsPerLine) + (pt.x/(m_cellSize.x+1));