#if wxUSE_CONFIG && wxUSE_FILECONFIG
// remember this in the config
- wxFontMapperPathChanger path(this,
- FONTMAPPER_FONT_FROM_ENCODING_PATH);
- if ( path.IsOk() )
+ wxFontMapperPathChanger path2(this,
+ FONTMAPPER_FONT_FROM_ENCODING_PATH);
+ if ( path2.IsOk() )
{
GetConfig()->Write(configEntry, info->ToString());
}
//
// remember it to avoid asking the same question again later
#if wxUSE_CONFIG && wxUSE_FILECONFIG
- wxFontMapperPathChanger path(this,
- FONTMAPPER_FONT_FROM_ENCODING_PATH);
- if ( path.IsOk() )
+ wxFontMapperPathChanger path2(this,
+ FONTMAPPER_FONT_FROM_ENCODING_PATH);
+ if ( path2.IsOk() )
{
GetConfig()->Write
(
wxRealPoint p3 = rotated_point (GetWidth(), 0, cos_angle, sin_angle, p0);
wxRealPoint p4 = rotated_point (GetWidth(), GetHeight(), cos_angle, sin_angle, p0);
- int x1 = (int) floor (wxMin (wxMin(p1.x, p2.x), wxMin(p3.x, p4.x)));
- int y1 = (int) floor (wxMin (wxMin(p1.y, p2.y), wxMin(p3.y, p4.y)));
- int x2 = (int) ceil (wxMax (wxMax(p1.x, p2.x), wxMax(p3.x, p4.x)));
- int y2 = (int) ceil (wxMax (wxMax(p1.y, p2.y), wxMax(p3.y, p4.y)));
+ int x1a = (int) floor (wxMin (wxMin(p1.x, p2.x), wxMin(p3.x, p4.x)));
+ int y1a = (int) floor (wxMin (wxMin(p1.y, p2.y), wxMin(p3.y, p4.y)));
+ int x2a = (int) ceil (wxMax (wxMax(p1.x, p2.x), wxMax(p3.x, p4.x)));
+ int y2a = (int) ceil (wxMax (wxMax(p1.y, p2.y), wxMax(p3.y, p4.y)));
// Create rotated image
- wxImage rotated (x2 - x1 + 1, y2 - y1 + 1, false);
+ wxImage rotated (x2a - x1a + 1, y2a - y1a + 1, false);
// With alpha channel
if (has_alpha)
rotated.SetAlpha();
if (offset_after_rotation != NULL)
{
- *offset_after_rotation = wxPoint (x1, y1);
+ *offset_after_rotation = wxPoint (x1a, y1a);
}
// GRG: The rotated (destination) image is always accessed
{
for (x = 0; x < rotated.GetWidth(); x++)
{
- wxRealPoint src = rotated_point (x + x1, y + y1, cos_angle, -sin_angle, p0);
+ wxRealPoint src = rotated_point (x + x1a, y + y1a, cos_angle, -sin_angle, p0);
if (-0.25 < src.x && src.x < GetWidth() - 0.75 &&
-0.25 < src.y && src.y < GetHeight() - 0.75)
// interpolate using the 4 enclosing grid-points. Those
// points can be obtained using floor and ceiling of the
// exact coordinates of the point
- // C.M. 2000-02-17: when the point is near the border, special care is required.
-
int x1, y1, x2, y2;
if (0 < src.x && src.x < GetWidth() - 1)
*(dst++) = *p;
if (has_alpha)
- {
- unsigned char *p = alpha[y1] + x1;
- *(alpha_dst++) = *p;
- }
+ *(alpha_dst++) = *(alpha[y1] + x1);
}
else if (d2 < gs_Epsilon)
{
*(dst++) = *p;
if (has_alpha)
- {
- unsigned char *p = alpha[y1] + x2;
- *(alpha_dst++) = *p;
- }
+ *(alpha_dst++) = *(alpha[y1] + x2);
}
else if (d3 < gs_Epsilon)
{
*(dst++) = *p;
if (has_alpha)
- {
- unsigned char *p = alpha[y2] + x2;
- *(alpha_dst++) = *p;
- }
+ *(alpha_dst++) = *(alpha[y2] + x2);
}
else if (d4 < gs_Epsilon)
{
*(dst++) = *p;
if (has_alpha)
- {
- unsigned char *p = alpha[y2] + x1;
- *(alpha_dst++) = *p;
- }
+ *(alpha_dst++) = *(alpha[y2] + x1);
}
else
{
if (has_alpha)
{
- unsigned char *v1 = alpha[y1] + (x1);
- unsigned char *v2 = alpha[y1] + (x2);
- unsigned char *v3 = alpha[y2] + (x2);
- unsigned char *v4 = alpha[y2] + (x1);
+ v1 = alpha[y1] + (x1);
+ v2 = alpha[y1] + (x2);
+ v3 = alpha[y2] + (x2);
+ v4 = alpha[y2] + (x1);
*(alpha_dst++) = (unsigned char)
( (w1 * *v1 + w2 * *v2 +
{
for (x = 0; x < rotated.GetWidth(); x++)
{
- wxRealPoint src = rotated_point (x + x1, y + y1, cos_angle, -sin_angle, p0);
+ wxRealPoint src = rotated_point (x + x1a, y + y1a, cos_angle, -sin_angle, p0);
const int xs = wxCint (src.x); // wxCint rounds to the
const int ys = wxCint (src.y); // closest integer
*(dst++) = *p;
if (has_alpha)
- {
- unsigned char *p = alpha[ys] + (xs);
- *(alpha_dst++) = *p;
- }
+ *(alpha_dst++) = *(alpha[ys] + (xs));
}
else
{
wxToolBarToolsList::compatibility_iterator nodeNext = node->GetNext();
while ( nodeNext )
{
- wxToolBarToolBase *tool = nodeNext->GetData();
+ wxToolBarToolBase *toolNext = nodeNext->GetData();
- if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
+ if ( !toolNext->IsButton() || toolNext->GetKind() != wxITEM_RADIO )
break;
- if ( tool->Toggle(false) )
+ if ( toolNext->Toggle(false) )
{
- DoToggleTool(tool, false);
+ DoToggleTool(toolNext, false);
}
nodeNext = nodeNext->GetNext();
wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious();
while ( nodePrev )
{
- wxToolBarToolBase *tool = nodePrev->GetData();
+ wxToolBarToolBase *toolNext = nodePrev->GetData();
- if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
+ if ( !toolNext->IsButton() || toolNext->GetKind() != wxITEM_RADIO )
break;
- if ( tool->Toggle(false) )
+ if ( toolNext->Toggle(false) )
{
- DoToggleTool(tool, false);
+ DoToggleTool(toolNext, false);
}
nodePrev = nodePrev->GetPrevious();
case wxCAL_HITTEST_HEADER:
{
- wxCalendarEvent event(this, wxEVT_CALENDAR_WEEKDAY_CLICKED);
- event.m_wday = wday;
- (void)GetEventHandler()->ProcessEvent(event);
+ wxCalendarEvent eventWd(this, wxEVT_CALENDAR_WEEKDAY_CLICKED);
+ eventWd.m_wday = wday;
+ (void)GetEventHandler()->ProcessEvent(eventWd);
}
break;
double bluePS = (double)(blue) / 255.0;
double greenPS = (double)(green) / 255.0;
- char buffer[100];
sprintf( buffer,
"%.8f %.8f %.8f setrgbcolor\n",
redPS, greenPS, bluePS );
{
wxCoord uy = (wxCoord)(y + size - m_underlinePosition);
wxCoord w, h;
- char buffer[100];
GetTextExtent(text, &w, &h);
sprintf( buffer,
// Now do the filenames -- but only if we're allowed to
if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0)
{
- wxLogNull log;
-
d.Open(dirName);
if (d.IsOpened())
size_t i;
for (i = 0; i < dirs.Count(); i++)
{
- wxString eachFilename(dirs[i]);
+ eachFilename = dirs[i];
path = dirName;
if (!wxEndsWithPathSeparator(path))
path += wxString(wxFILE_SEP_PATH);
{
for (i = 0; i < filenames.Count(); i++)
{
- wxString eachFilename(filenames[i]);
+ eachFilename = filenames[i];
path = dirName;
if (!wxEndsWithPathSeparator(path))
path += wxString(wxFILE_SEP_PATH);
if (id.IsOk())
lastId = id;
}
- if (lastId.IsOk())
+ if (!lastId.IsOk())
+ return false;
+
+ wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(lastId);
+ if (data->m_isDir)
{
- wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(lastId);
- if (data->m_isDir)
- {
- m_treeCtrl->Expand(lastId);
- }
- if ((GetWindowStyle() & wxDIRCTRL_SELECT_FIRST) && data->m_isDir)
+ m_treeCtrl->Expand(lastId);
+ }
+ if ((GetWindowStyle() & wxDIRCTRL_SELECT_FIRST) && data->m_isDir)
+ {
+ // Find the first file in this directory
+ wxTreeItemIdValue cookie;
+ wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie);
+ bool selectedChild = false;
+ while (childId.IsOk())
{
- // Find the first file in this directory
- wxTreeItemIdValue cookie;
- wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie);
- bool selectedChild = false;
- while (childId.IsOk())
- {
- wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
+ data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
- if (data && data->m_path != wxEmptyString && !data->m_isDir)
- {
- m_treeCtrl->SelectItem(childId);
- m_treeCtrl->EnsureVisible(childId);
- selectedChild = true;
- break;
- }
- childId = m_treeCtrl->GetNextChild(lastId, cookie);
- }
- if (!selectedChild)
+ if (data && data->m_path != wxEmptyString && !data->m_isDir)
{
- m_treeCtrl->SelectItem(lastId);
- m_treeCtrl->EnsureVisible(lastId);
+ m_treeCtrl->SelectItem(childId);
+ m_treeCtrl->EnsureVisible(childId);
+ selectedChild = true;
+ break;
}
+ childId = m_treeCtrl->GetNextChild(lastId, cookie);
}
- else
+ if (!selectedChild)
{
m_treeCtrl->SelectItem(lastId);
m_treeCtrl->EnsureVisible(lastId);
}
-
- return true;
}
else
- return false;
+ {
+ m_treeCtrl->SelectItem(lastId);
+ m_treeCtrl->EnsureVisible(lastId);
+ }
+
+ return true;
}
wxString wxGenericDirCtrl::GetPath() const
//
else if (event.LeftDClick() )
{
- int row = YToEdgeOfRow(y);
+ row = YToEdgeOfRow(y);
if ( row < 0 )
{
row = YToRow(y);
//
if ( event.LeftDClick() )
{
- int col = XToEdgeOfCol(x);
+ col = XToEdgeOfCol(x);
if ( col < 0 )
{
col = XToCol(x);
// (unless we are in column selection mode).
if ( m_selectionMode != wxGrid::wxGridSelectColumns )
{
- size_t count = m_rowSelection.GetCount();
+ count = m_rowSelection.GetCount();
for ( size_t n = 0; n < count; n++ )
{
if ( row == m_rowSelection[n] )
// (unless we are in row selection mode).
if ( m_selectionMode != wxGrid::wxGridSelectRows )
{
- size_t count = m_colSelection.GetCount();
+ count = m_colSelection.GetCount();
for ( size_t n = 0; n < count; n++ )
{
if ( col == m_colSelection[n] )
count = m_cellSelection.GetCount();
for ( n = 0; n < count; n++ )
{
- wxGridCellCoords& coords = m_cellSelection[n];
- if ( row == coords.GetRow() && col == coords.GetCol() )
+ const wxGridCellCoords& sel = m_cellSelection[n];
+ if ( row == sel.GetRow() && col == sel.GetCol() )
{
wxGridCellCoords coords = m_cellSelection[n];
m_cellSelection.RemoveAt(n);
dragRect = wxRect(x, y, newWidth, newHeight);
- wxSashEvent event(GetId(), edge);
- event.SetEventObject(this);
- event.SetDragStatus(status);
- event.SetDragRect(dragRect);
- GetEventHandler()->ProcessEvent(event);
+ wxSashEvent eventSash(GetId(), edge);
+ eventSash.SetEventObject(this);
+ eventSash.SetDragStatus(status);
+ eventSash.SetDragRect(dragRect);
+ GetEventHandler()->ProcessEvent(eventSash);
}
else if ( event.LeftUp() )
{
m_windowOne = m_windowTwo;
m_windowTwo = (wxWindow *) NULL;
OnUnsplit(removedWindow);
- wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
- event.m_data.win = removedWindow;
- (void)DoSendEvent(event);
+ wxSplitterEvent eventUnsplit(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+ eventUnsplit.m_data.win = removedWindow;
+ (void)DoSendEvent(eventUnsplit);
SetSashPositionAndNotify(0);
}
else if ( posSashNew == GetWindowSize() )
wxWindow *removedWindow = m_windowTwo;
m_windowTwo = (wxWindow *) NULL;
OnUnsplit(removedWindow);
- wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
- event.m_data.win = removedWindow;
- (void)DoSendEvent(event);
+ wxSplitterEvent eventUnsplit(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+ eventUnsplit.m_data.win = removedWindow;
+ (void)DoSendEvent(eventUnsplit);
SetSashPositionAndNotify(0);
}
else
wxRect ItemRect;
GetBoundingRect(m_current, ItemRect, true);
- wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_MENU, GetId() );
- event.m_item = m_current;
+ wxTreeEvent eventMenu( wxEVT_COMMAND_TREE_ITEM_MENU, GetId() );
+ eventMenu.m_item = m_current;
// Use the left edge, vertical middle
- event.m_pointDrag = wxPoint(ItemRect.GetX(),
- ItemRect.GetY() + ItemRect.GetHeight() / 2);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
+ eventMenu.m_pointDrag = wxPoint(ItemRect.GetX(),
+ ItemRect.GetY() + ItemRect.GetHeight() / 2);
+ eventMenu.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( eventMenu );
break;
}
case ' ':
case WXK_RETURN:
if ( !event.HasModifiers() )
{
- wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
- event.m_item = m_current;
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
+ wxTreeEvent eventAct( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
+ eventAct.m_item = m_current;
+ eventAct.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( eventAct );
}
// in any case, also generate the normal key event for this key,
}
// generate the drag end event
- wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, GetId());
+ wxTreeEvent eventEndDrag(wxEVT_COMMAND_TREE_END_DRAG, GetId());
- event.m_item = item;
- event.m_pointDrag = pt;
- event.SetEventObject(this);
+ eventEndDrag.m_item = item;
+ eventEndDrag.m_pointDrag = pt;
+ eventEndDrag.SetEventObject(this);
- (void)GetEventHandler()->ProcessEvent(event);
+ (void)GetEventHandler()->ProcessEvent(eventEndDrag);
m_isDragging = false;
m_dropTarget = (wxGenericTreeItem *)NULL;
void wxVListBox::OnLeftDown(wxMouseEvent& event)
{
SetFocus();
-
+
int item = HitTest(event.GetPosition());
if ( item != wxNOT_FOUND )
}
}
-void wxVListBox::OnLeftDClick(wxMouseEvent& event)
+void wxVListBox::OnLeftDClick(wxMouseEvent& eventMouse)
{
- int item = HitTest(event.GetPosition());
+ int item = HitTest(eventMouse.GetPosition());
if ( item != wxNOT_FOUND )
{
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, GetId());
if (is_mono)
{
#ifdef __WXGTK20__
- GdkPixmap *bitmap = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, -1 );
- GdkGC *gc = gdk_gc_new( bitmap );
+ GdkPixmap *bitmap2 = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, -1 );
+ GdkGC *gc = gdk_gc_new( bitmap2 );
gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() );
gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() );
- gdk_wx_draw_bitmap( bitmap, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
+ gdk_wx_draw_bitmap( bitmap2, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
- gdk_draw_drawable( m_window, m_textGC, bitmap, 0, 0, xx, yy, -1, -1 );
+ gdk_draw_drawable( m_window, m_textGC, bitmap2, 0, 0, xx, yy, -1, -1 );
- gdk_bitmap_unref( bitmap );
+ gdk_bitmap_unref( bitmap2 );
gdk_gc_unref( gc );
#else
gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 );
wxMenu* menu = node->GetData();
- wxString str( wxReplaceUnderscore( label ) );
+ const wxString str( wxReplaceUnderscore( label ) );
menu->SetTitle( str );
if (menu->m_owner)
{
- GtkLabel *label = GTK_LABEL( GTK_BIN(menu->m_owner)->child );
+ GtkLabel *glabel = GTK_LABEL( GTK_BIN(menu->m_owner)->child );
/* set new text */
- gtk_label_set( label, wxGTK_CONV( str ) );
+ gtk_label_set( glabel, wxGTK_CONV( str ) );
/* reparse key accel */
- (void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( str ) );
- gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
+ (void)gtk_label_parse_uline (GTK_LABEL(glabel), wxGTK_CONV( str ) );
+ gtk_accel_label_refetch( GTK_ACCEL_LABEL(glabel) );
}
}
#include "wx/dcclient.h"
#include "wx/panel.h"
#include "wx/sizer.h"
+#include "wx/math.h"
#include "wx/gtk/private.h"
#include "wx/gtk/win_gtk.h"
if (g_blockEventsOnDrag) return;
if (!win->m_hasVMT) return;
-
+
win->GtkVScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) );
}
PostCreation();
Show( TRUE );
-
+
return TRUE;
}
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
int old_x = m_xScrollPixelsPerLine * xs;
int old_y = m_yScrollPixelsPerLine * ys;
m_targetWindow->GetClientSize( &w, &h );
m_targetWindow->GetVirtualSize( &vw, &vh );
-
+
if (m_xScrollPixelsPerLine == 0)
{
m_hAdjust->upper = 1.0;
// Special case. When client and virtual size are very close but
// the client is big enough, kill scrollbar.
-
- if ((m_hAdjust->page_size < m_hAdjust->upper) && (w >= vw))
+
+ if ((m_hAdjust->page_size < m_hAdjust->upper) && (w >= vw))
m_hAdjust->page_size += 1.0;
-
+
// If the scrollbar hits the right side, move the window
// right to keep it from over extending.
- if ((m_hAdjust->value != 0.0) && (m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper))
+ if ( !wxIsNullDouble(m_hAdjust->value) &&
+ (m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper) )
{
m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size;
if (m_hAdjust->value < 0.0)
m_hAdjust->value = 0.0;
-
+
if (GetChildren().GetCount() == 0)
m_xScrollPosition = (int)m_hAdjust->value; // This is enough without child windows
else
m_vAdjust->upper = (vh+m_yScrollPixelsPerLine-1) / m_yScrollPixelsPerLine;
m_vAdjust->page_size = h / m_yScrollPixelsPerLine;
m_vAdjust->page_increment = h / m_yScrollPixelsPerLine;
-
- if ((m_vAdjust->page_size < m_vAdjust->upper) && (h >= vh))
+
+ if ((m_vAdjust->page_size < m_vAdjust->upper) && (h >= vh))
m_vAdjust->page_size += 1.0;
- if ((m_vAdjust->value != 0.0) && (m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper))
+ if ( !wxIsNullDouble(m_vAdjust->value) &&
+ (m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper) )
{
m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size;
if (m_vAdjust->value < 0.0)
m_vAdjust->value = 0.0;
-
+
if (GetChildren().GetCount() == 0)
- m_yScrollPosition = (int)m_vAdjust->value;
+ m_yScrollPosition = (int)m_vAdjust->value;
else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
}
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
if ( xx )
*xx = x - xs * m_xScrollPixelsPerLine;
if ( yy )
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
if ( xx )
*xx = x + xs * m_xScrollPixelsPerLine;
if ( yy )
if ( m_targetWindow->GetAutoLayout() )
{
wxSize size = m_targetWindow->GetBestVirtualSize();
-
+
// This will call ::Layout() and ::AdjustScrollbars()
SetVirtualSize( size );
}
if (is_mono)
{
#ifdef __WXGTK20__
- GdkPixmap *bitmap = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, -1 );
- GdkGC *gc = gdk_gc_new( bitmap );
+ GdkPixmap *bitmap2 = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, -1 );
+ GdkGC *gc = gdk_gc_new( bitmap2 );
gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() );
gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() );
- gdk_wx_draw_bitmap( bitmap, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
+ gdk_wx_draw_bitmap( bitmap2, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
- gdk_draw_drawable( m_window, m_textGC, bitmap, 0, 0, xx, yy, -1, -1 );
+ gdk_draw_drawable( m_window, m_textGC, bitmap2, 0, 0, xx, yy, -1, -1 );
- gdk_bitmap_unref( bitmap );
+ gdk_bitmap_unref( bitmap2 );
gdk_gc_unref( gc );
#else
gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 );
wxMenu* menu = node->GetData();
- wxString str( wxReplaceUnderscore( label ) );
+ const wxString str( wxReplaceUnderscore( label ) );
menu->SetTitle( str );
if (menu->m_owner)
{
- GtkLabel *label = GTK_LABEL( GTK_BIN(menu->m_owner)->child );
+ GtkLabel *glabel = GTK_LABEL( GTK_BIN(menu->m_owner)->child );
/* set new text */
- gtk_label_set( label, wxGTK_CONV( str ) );
+ gtk_label_set( glabel, wxGTK_CONV( str ) );
/* reparse key accel */
- (void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( str ) );
- gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
+ (void)gtk_label_parse_uline (GTK_LABEL(glabel), wxGTK_CONV( str ) );
+ gtk_accel_label_refetch( GTK_ACCEL_LABEL(glabel) );
}
}
#include "wx/dcclient.h"
#include "wx/panel.h"
#include "wx/sizer.h"
+#include "wx/math.h"
#include "wx/gtk/private.h"
#include "wx/gtk/win_gtk.h"
if (g_blockEventsOnDrag) return;
if (!win->m_hasVMT) return;
-
+
win->GtkVScroll( adjust->value,
GET_SCROLL_TYPE(GTK_SCROLLED_WINDOW(win->m_widget)->vscrollbar) );
}
PostCreation();
Show( TRUE );
-
+
return TRUE;
}
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
int old_x = m_xScrollPixelsPerLine * xs;
int old_y = m_yScrollPixelsPerLine * ys;
m_targetWindow->GetClientSize( &w, &h );
m_targetWindow->GetVirtualSize( &vw, &vh );
-
+
if (m_xScrollPixelsPerLine == 0)
{
m_hAdjust->upper = 1.0;
// Special case. When client and virtual size are very close but
// the client is big enough, kill scrollbar.
-
- if ((m_hAdjust->page_size < m_hAdjust->upper) && (w >= vw))
+
+ if ((m_hAdjust->page_size < m_hAdjust->upper) && (w >= vw))
m_hAdjust->page_size += 1.0;
-
+
// If the scrollbar hits the right side, move the window
// right to keep it from over extending.
- if ((m_hAdjust->value != 0.0) && (m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper))
+ if ( !wxIsNullDouble(m_hAdjust->value) &&
+ (m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper) )
{
m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size;
if (m_hAdjust->value < 0.0)
m_hAdjust->value = 0.0;
-
+
if (GetChildren().GetCount() == 0)
m_xScrollPosition = (int)m_hAdjust->value; // This is enough without child windows
else
m_vAdjust->upper = (vh+m_yScrollPixelsPerLine-1) / m_yScrollPixelsPerLine;
m_vAdjust->page_size = h / m_yScrollPixelsPerLine;
m_vAdjust->page_increment = h / m_yScrollPixelsPerLine;
-
- if ((m_vAdjust->page_size < m_vAdjust->upper) && (h >= vh))
+
+ if ((m_vAdjust->page_size < m_vAdjust->upper) && (h >= vh))
m_vAdjust->page_size += 1.0;
- if ((m_vAdjust->value != 0.0) && (m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper))
+ if ( !wxIsNullDouble(m_vAdjust->value) &&
+ (m_vAdjust->value + m_vAdjust->page_size > m_vAdjust->upper) )
{
m_vAdjust->value = m_vAdjust->upper - m_vAdjust->page_size;
if (m_vAdjust->value < 0.0)
m_vAdjust->value = 0.0;
-
+
if (GetChildren().GetCount() == 0)
- m_yScrollPosition = (int)m_vAdjust->value;
+ m_yScrollPosition = (int)m_vAdjust->value;
else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
}
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
if ( xx )
*xx = x - xs * m_xScrollPixelsPerLine;
if ( yy )
{
int xs, ys;
GetViewStart (& xs, & ys);
-
+
if ( xx )
*xx = x + xs * m_xScrollPixelsPerLine;
if ( yy )
if ( m_targetWindow->GetAutoLayout() )
{
wxSize size = m_targetWindow->GetBestVirtualSize();
-
+
// This will call ::Layout() and ::AdjustScrollbars()
SetVirtualSize( size );
}