// Release lock again
gdk_threads_leave();
-
+
{
// If another idle source was added, remove it
#if wxUSE_THREADS
g_signal_connect_after (m_widget, "changed",
G_CALLBACK (gtkcombobox_changed_callback), this);
-
+
}
else
#endif
// skip the slashes
lenPrefix += 2;
}
-
+
// It would probably be nicer to use a GTK or Glib
// function to unescape the 8-bit strings pointed to
// by buf, but this does the same in wx code.
g_value_unset( &gvalue );
}
-// ---------------------------------------------------------
+// ---------------------------------------------------------
// wxDataViewBitmapRenderer
-// ---------------------------------------------------------
+// ---------------------------------------------------------
IMPLEMENT_CLASS(wxDataViewBitmapRenderer, wxDataViewRenderer)
{
wxBitmap bitmap;
bitmap << value;
-
+
// This may create a Pixbuf representation in the
// wxBitmap object (and it will stay there)
GdkPixbuf *pixbuf = bitmap.GetPixbuf();
-
+
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_OBJECT );
g_value_set_object( &gvalue, pixbuf );
g_object_set_property( G_OBJECT(m_renderer), "pixbuf", &gvalue );
g_value_unset( &gvalue );
-
+
return true;
}
-
+
if (value.GetType() == wxT("wxIcon"))
{
wxIcon bitmap;
bitmap << value;
-
+
// This may create a Pixbuf representation in the
// wxBitmap object (and it will stay there)
GdkPixbuf *pixbuf = bitmap.GetPixbuf();
-
+
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_OBJECT );
g_value_set_object( &gvalue, pixbuf );
g_object_set_property( G_OBJECT(m_renderer), "pixbuf", &gvalue );
g_value_unset( &gvalue );
-
+
return true;
}
-
+
return false;
}
{
return false;
}
-
+
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
{
if (gdk_event->type != GDK_BUTTON_PRESS)
return TRUE;
-
+
if (gdk_event->button == 1)
{
wxDataViewCtrl *dv = column->GetOwner();
event.SetModel( dv->GetModel() );
dv->GetEventHandler()->ProcessEvent( event );
}
-
+
return TRUE;
}
list_store->model->GetValue( value, cell->GetOwner()->GetModelColumn(), model_row );
if (value.GetType() != cell->GetVariantType())
- wxLogError( wxT("Wrong type, required: %s but: %s"),
- value.GetType().c_str(),
+ wxLogError( wxT("Wrong type, required: %s but: %s"),
+ value.GetType().c_str(),
cell->GetVariantType().c_str() );
cell->SetValue( value );
IMPLEMENT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
-wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell,
- unsigned int model_column, int width,
+wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell,
+ unsigned int model_column, int width,
wxAlignment align, int flags ) :
wxDataViewColumnBase( title, cell, model_column, width, align, flags )
{
SetTitle( title );
}
-wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *cell,
- unsigned int model_column, int width,
+wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *cell,
+ unsigned int model_column, int width,
wxAlignment align, int flags ) :
wxDataViewColumnBase( bitmap, cell, model_column, width, align, flags )
{
{
if (m_isConnected)
return;
-
+
if (GTK_WIDGET_REALIZED(GetOwner()->m_treeview))
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
{
g_signal_connect(column->button, "button_press_event",
G_CALLBACK (gtk_dataview_header_button_press_callback), this);
-
+
m_isConnected = true;
}
}
void wxDataViewColumn::SetOwner( wxDataViewCtrl *owner )
{
wxDataViewColumnBase::SetOwner( owner );
-
+
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
-
+
gtk_tree_view_column_set_title( column, wxGTK_CONV_FONT(GetTitle(), GetOwner()->GetFont() ) );
}
void wxDataViewColumn::SetTitle( const wxString &title )
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
-
+
if (m_isConnected)
{
// disconnect before column->button gets recreated
- g_signal_handlers_disconnect_by_func( column->button,
+ g_signal_handlers_disconnect_by_func( column->button,
(GtkWidget*) gtk_dataview_header_button_press_callback, this);
-
+
m_isConnected = false;
}
if (bitmap.Ok())
{
GtkImage *gtk_image = GTK_IMAGE( gtk_image_new() );
-
+
GdkBitmap *mask = (GdkBitmap *) NULL;
if (bitmap.GetMask())
mask = bitmap.GetMask()->GetBitmap();
bitmap.GetPixmap(), mask);
}
gtk_widget_show( GTK_WIDGET(gtk_image) );
-
+
gtk_tree_view_column_set_widget( column, GTK_WIDGET(gtk_image) );
}
else
void wxDataViewColumn::SetAlignment( wxAlignment align )
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
-
+
gfloat xalign = 0.0;
if (align == wxALIGN_RIGHT)
xalign = 1.0;
if (align == wxALIGN_CENTER_HORIZONTAL ||
align == wxALIGN_CENTER)
xalign = 0.5;
-
+
gtk_tree_view_column_set_alignment( column, xalign );
}
return wxALIGN_RIGHT;
if (xalign == 0.5)
return wxALIGN_CENTER_HORIZONTAL;
-
+
return wxALIGN_LEFT;
}
void wxDataViewColumn::SetSortOrder( bool ascending )
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
-
+
if (ascending)
gtk_tree_view_column_set_sort_order( column, GTK_SORT_ASCENDING );
else
bool wxDataViewColumn::IsSortOrderAscending() const
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
-
+
return (gtk_tree_view_column_get_sort_order( column ) != GTK_SORT_DESCENDING);
}
{
if (!GTK_WIDGET_REALIZED(dv->m_widget))
return;
-
+
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ROW_SELECTED, dv->GetId() );
event.SetRow( dv->GetSelection() );
event.SetModel( dv->GetModel() );
}
static void
-wxdataview_row_activated_callback( GtkTreeView* treeview, GtkTreePath *path,
+wxdataview_row_activated_callback( GtkTreeView* treeview, GtkTreePath *path,
GtkTreeViewColumn *column, wxDataViewCtrl *dv )
{
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ROW_ACTIVATED, dv->GetId() );
if (!gtk_check_version(2,10,0))
{
GtkTreeViewGridLines grid = GTK_TREE_VIEW_GRID_LINES_NONE;
-
- if ((style & wxDV_HORIZ_RULES) != 0 &&
+
+ if ((style & wxDV_HORIZ_RULES) != 0 &&
(style & wxDV_VERT_RULES) != 0)
grid = GTK_TREE_VIEW_GRID_LINES_BOTH;
else if (style & wxDV_VERT_RULES)
void wxDataViewCtrl::OnInternalIdle()
{
wxWindow::OnInternalIdle();
-
+
unsigned int cols = GetColumnCount();
unsigned int i;
for (i = 0; i < cols; i++)
void wxDataViewCtrl::SetSelection( int row )
{
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
-
+
if (row < 0)
{
gtk_tree_selection_unselect_all( selection );
{
GtkTreePath *path = gtk_tree_path_new ();
gtk_tree_path_append_index( path, row );
-
+
gtk_tree_selection_select_path( selection, path );
-
+
gtk_tree_path_free( path );
}
}
void wxDataViewCtrl::Unselect( unsigned int row )
{
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
-
+
GtkTreePath *path = gtk_tree_path_new ();
gtk_tree_path_append_index( path, row );
-
+
gtk_tree_selection_unselect_path( selection, path );
-
+
gtk_tree_path_free( path );
}
void wxDataViewCtrl::SetSelections( const wxArrayInt& aSelections)
{
}
-
+
bool wxDataViewCtrl::IsSelected( unsigned int row ) const
{
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
-
+
GtkTreePath *path = gtk_tree_path_new ();
gtk_tree_path_append_index( path, row );
-
+
gboolean ret = gtk_tree_selection_path_is_selected( selection, path );
-
+
gtk_tree_path_free( path );
-
+
return ret;
}
{
GtkTreeModel *model;
GList *list = gtk_tree_selection_get_selected_rows( selection, &model );
-
+
// do something
if (list)
{
// list = g_list_nth( list, 0 ); should be a noop
GtkTreePath *path = (GtkTreePath*) list->data;
-
+
unsigned int row = (unsigned int)gtk_tree_path_get_indices (path)[0];
-
+
// delete list
g_list_foreach( list, (GFunc) gtk_tree_path_free, NULL );
g_list_free( list );
-
+
return (int) row;
}
}
else
{
-
+
GtkTreeModel *model;
GtkTreeIter iter;
gboolean has_selection = gtk_tree_selection_get_selected( selection, &model, &iter );
return (int) row;
}
}
-
+
return -1;
}
{
GtkTreeModel *model;
GList *list = gtk_tree_selection_get_selected_rows( selection, &model );
-
+
int count = 0;
while (list)
{
-
+
// list = g_list_nth( list, 0 ); should be a noop
GtkTreePath *path = (GtkTreePath*) list->data;
-
+
unsigned int row = (unsigned int)gtk_tree_path_get_indices (path)[0];
-
+
aSelections.Add( (int) row );
-
- list = g_list_next( list );
+
+ list = g_list_next( list );
}
-
+
// delete list
g_list_foreach( list, (GFunc) gtk_tree_path_free, NULL );
g_list_free( list );
-
+
return count;
}
else
return 1;
}
}
-
+
return 0;
}
standard (as e.g. wxStatusBar) */
m_owner = window;
-
+
if (m_owner && m_owner->m_wxwindow && (m_owner->GetLayoutDirection() == wxLayout_RightToLeft))
{
// reverse sense
gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
gdk_gc_set_fill( m_textGC, GDK_SOLID );
-
+
gdk_gc_set_colormap( m_textGC, m_cmap );
/* m_penGC */
gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-2, hh-2 );
gdk_draw_rectangle( m_window, m_penGC, FALSE, xx-1, yy-1, ww, hh );
}
-
+
// reset
gdk_gc_set_line_attributes( m_penGC, 2, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND );
}
int w = bitmap.GetWidth();
int h = bitmap.GetHeight();
-
+
if (m_owner && m_owner->GetLayoutDirection() == wxLayout_RightToLeft)
xx -= w;
-
+
CalcBoundingBox( x, y );
CalcBoundingBox( x + w, y + h );
wxMemoryDC *memDC = wxDynamicCast(source, wxMemoryDC);
wxBitmap selected = source->GetSelectedBitmap();
-
+
bool use_bitmap_method = false;
bool is_mono = false;
}
if (memDC && !selected.Ok()) return false;
-
+
if (selected.Ok())
{
is_mono = (selected.GetDepth() == 1);
GdkWindow* window = source->GetGDKWindow();
if ( !window )
return false;
-
+
// copy including child window contents
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
gdk_draw_drawable( m_window, m_penGC,
gdk_draw_rectangle(m_window, m_textGC, TRUE, x, y, w, h);
gdk_gc_set_foreground(m_textGC, m_textForegroundColour.GetColor());
}
-
+
// Draw layout.
if (m_owner && m_owner->GetLayoutDirection() == wxLayout_RightToLeft)
gdk_draw_layout( m_window, m_textGC, x-w, y, m_layout );
}
pango_layout_set_text( m_layout, dataUTF8, strlen(dataUTF8) );
-
+
// Calculate the position of each character based on the widths of
// the previous characters
{
m_deviceOriginX = x;
m_deviceOriginY = y;
-
+
ComputeScaleAndOrigin();
}
{
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1);
-
+
if (m_owner && m_owner->m_wxwindow && (m_owner->GetLayoutDirection() == wxLayout_RightToLeft))
- m_signX = -m_signX;
-
+ m_signX = -m_signX;
+
ComputeScaleAndOrigin();
}
#ifdef __WXDEBUG__
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned FALSE") );
#endif
-
+
/* cancel the whole thing */
gtk_drag_finish( context,
FALSE, /* no success */
#ifdef __WXDEBUG__
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned true") );
#endif
-
+
#if wxUSE_THREADS
/* disable GUI threads */
#endif
#ifdef __WXDEBUG__
wxLogTrace(TRACE_DND, wxT( "Drop target: data received event") );
#endif
-
+
/* inform the wxDropTarget about the current GtkSelectionData.
this is only valid for the duration of this call */
drop_target->SetDragData( data );
#ifdef __WXDEBUG__
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned true") );
#endif
-
+
/* tell GTK that data transfer was successful */
gtk_drag_finish( context, TRUE, FALSE, time );
}
#ifdef __WXDEBUG__
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned FALSE") );
#endif
-
+
/* tell GTK that data transfer was not successful */
gtk_drag_finish( context, FALSE, FALSE, time );
}
wxLogTrace(TRACE_DND, wxT("Drop source: format requested: %s"),
format.GetId().c_str());
#endif
-
+
drop_source->m_retValue = wxDragCancel;
wxDataObject *data = drop_source->GetDataObject();
// don't start dragging if no button is down
if (g_lastButtonNumber == 0)
return wxDragNone;
-
+
// we can only start a drag after a mouse event
if (g_lastMouseEvent == NULL)
return wxDragNone;
#if wxUSE_STATUSBAR
// status bar
- if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
+ if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
!(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOSTATUSBAR) != 0))
(*height) -= wxSTATUS_HEIGHT;
#endif // wxUSE_STATUSBAR
#if wxUSE_STATUSBAR
// status bar
- if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
+ if (m_frameStatusBar && m_frameStatusBar->IsShown() &&
!(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOSTATUSBAR) != 0))
height += wxSTATUS_HEIGHT;
#endif
{
if (!GTK_WIDGET_VISIBLE(m_frameStatusBar->m_widget))
gtk_widget_show( m_frameStatusBar->m_widget );
-
+
int xx = 0 + m_miniEdge;
int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge - client_area_y_offset;
int ww = m_width - 2*m_miniEdge;
m_signX = 1; // default x-axis left to right
m_signY = -1; // default y-axis bottom up -> top down
-
+
GetSize( NULL, &m_deviceOffsetY );
}
m_currentGreen = 0;
m_signX = 1; // default x-axis left to right
- m_signY = -1; // default y-axis bottom up -> top down
-
+ m_signY = -1; // default y-axis bottom up -> top down
+
GetSize( NULL, &m_deviceOffsetY );
}
m_previewPrintout->SetPPIPrinter(wxGnomePrintDC::GetResolution(), wxGnomePrintDC::GetResolution());
wxSize sizeDevUnits(paper->GetSizeDeviceUnits());
-
+
// TODO: get better resolution information from wxGnomePrintDC, if possible.
sizeDevUnits.x = (wxCoord)((float)sizeDevUnits.x * wxGnomePrintDC::GetResolution() / 72.0);
// wxWindowGTK will connect to the enter_notify and leave_notify GTK+ signals
// thus overriding GTK+'s internal signal handlers which set the cursor of
- // the widget - thus we need to manually set it here:
+ // the widget - thus we need to manually set it here:
SetCursor(wxCursor(wxCURSOR_HAND));
}
else
if (listbox->IsSelected(sel))
{
GtkTreeEntry* entry = listbox->GtkGetEntry(sel);
-
+
if (entry)
{
event.SetInt(sel);
event.SetClientObject( (wxClientData*) gtk_tree_entry_get_userdata(entry) );
else if ( listbox->HasClientUntypedData() )
event.SetClientData( gtk_tree_entry_get_userdata(entry) );
-
+
g_object_unref (entry);
}
else
gtk_listitem_changed_callback( GtkTreeSelection* selection, wxListBox *listbox )
{
if (g_blockEventsOnDrag) return;
-
+
if (listbox->m_blockEvent) return;
-
+
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
event.SetEventObject( listbox );
{
wxArrayInt selections;
listbox->GetSelections( selections );
-
+
if (selections.GetCount() == 0)
{
// indicate that this is a deselection
event.SetExtraLong( 0 );
event.SetInt( -1 );
-
+
listbox->GetEventHandler()->ProcessEvent( event );
-
+
return;
}
else
// indicate that this is a selection
event.SetExtraLong( 1 );
event.SetInt( selections[0] );
-
+
listbox->GetEventHandler()->ProcessEvent( event );
}
}
// indicate that this is a deselection
event.SetExtraLong( 0 );
event.SetInt( -1 );
-
+
listbox->GetEventHandler()->ProcessEvent( event );
-
+
return;
}
else
GtkTreeSelection* selection = gtk_tree_view_get_selection( m_treeview );
-
+
g_signal_connect_after (selection, "changed",
G_CALLBACK (gtk_listitem_changed_callback), this);
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: main.cpp
-// Purpose: Entry point
-// Author: Julian Smart
-// Modified by:
-// Created: 17/09/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-
-// We don't put main() in the library any more. RR.
-
gint i = gtk_notebook_get_current_page( notebook );
if (i < 0) return (wxMDIChildFrame*) NULL;
-
+
GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data);
if (!page) return (wxMDIChildFrame*) NULL;
{
if ( wxPendingDelete.Member(node->GetData()) )
return (wxMDIChildFrame*) NULL;
-
+
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
if (!child_frame)
if (child_frame->m_page == page)
return child_frame;
-
+
node = node->GetNext();
}
if (style & wxYES_NO)
{
- if (style & wxCANCEL)
- buttons = GTK_BUTTONS_NONE;
- else
- buttons = GTK_BUTTONS_YES_NO;
+ if (style & wxCANCEL)
+ buttons = GTK_BUTTONS_NONE;
+ else
+ buttons = GTK_BUTTONS_YES_NO;
}
if (style & wxOK)
if (style & wxYES_NO)
{
if (style & wxCANCEL)
- {
+ {
gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_NO,
GTK_RESPONSE_NO);
gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button(GTK_DIALOG(m_widget), GTK_STOCK_YES,
GTK_RESPONSE_YES);
- }
+ }
if (style & wxNO_DEFAULT)
gtk_dialog_set_default_response(GTK_DIALOG(m_widget), GTK_RESPONSE_NO);
else
if ( !(flags & SetSelection_SendEvent) )
{
// reconnect to signals
-
+
g_signal_connect (m_widget, "switch_page",
G_CALLBACK (gtk_notebook_page_changing_callback), this);
/* show the label */
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
-
+
if (select && (m_pagesData.GetCount() > 1))
{
SetSelection( position );
wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& ri)
{
wxDELETEA(m_rects);
-
+
m_current = ri.m_current;
m_numRects = ri.m_numRects;
if ( m_numRects )
int x_diff = 0;
if (win->GetLayoutDirection() == wxLayout_RightToLeft)
x_diff = rect.width;
-
+
gtk_paint_box
(
button->style,
rect.height = full_size;
rect.width = w;
}
-
+
int x_diff = 0;
if (win->GetLayoutDirection() == wxLayout_RightToLeft)
x_diff = rect.width;
if (flags & wxCONTROL_CURRENT)
{
- gtk_paint_focus( win->m_widget->style,
+ gtk_paint_focus( win->m_widget->style,
gdk_window,
state,
NULL,
// since that is what the API wants. But the values
// are much bigger under GNOME than under Windows and
// just seem to much in many cases to be useful.
- // drag_threshold *= 2;
+ // drag_threshold *= 2;
return drag_threshold;
justify = GTK_JUSTIFY_RIGHT;
else // wxALIGN_LEFT is 0
justify = GTK_JUSTIFY_LEFT;
-
+
if (GetLayoutDirection() == wxLayout_RightToLeft)
- {
+ {
if (justify == GTK_JUSTIFY_RIGHT)
justify = GTK_JUSTIFY_LEFT;
if (justify == GTK_JUSTIFY_LEFT)
justify = GTK_JUSTIFY_RIGHT;
}
-
+
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
{
// this shouldn't happen...
if (win->GetParent()->m_wxwindow) return;
-
+
wxSize size = win->GetEffectiveMinSize();
if (size.y != alloc->height)
{
(const char *) NULL,
posGtk
);
-
+
// connect after in order to correct size_allocate events
g_signal_connect_after (tool->GetControl()->m_widget, "size_allocate",
G_CALLBACK (gtktoolwidget_size_callback), tool->GetControl());
-
+
break;
}
tool->SetNormalBitmap(bitmap);
tool->SetImage(tool->GetBitmap());
- }
+ }
}
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
tool->SetDisabledBitmap(bitmap);
tool->SetImage(tool->GetBitmap());
- }
+ }
}
// ----------------------------------------------------------------------------
{
// Check if we have to show window now
if (GtkShowFromOnIdle()) return;
-
+
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
g_return_val_if_fail ( (pizza != NULL), 0 );
g_return_val_if_fail ( (GTK_IS_PIZZA (pizza)), 0 );
-
+
if (!pizza->bin_window) return 0;
-
+
border = pizza->container.border_width;
-
+
return GTK_WIDGET(pizza)->allocation.width - border*2;
}
widget->allocation = *allocation;
border = pizza->container.border_width;
-
+
x = allocation->x + border;
y = allocation->y + border;
w = allocation->width - border*2;
if (gtk_widget_get_direction( GTK_WIDGET(pizza) ) == GTK_TEXT_DIR_RTL)
{
/* reverse horizontal placement */
- gint offset,border;
-
+ gint offset,border;
+
offset = GTK_WIDGET(pizza)->allocation.width;
border = pizza->container.border_width;
offset -= border*2;
-
- allocation.x = offset - child->x - allocation.width + pizza->m_xoffset;
+
+ allocation.x = offset - child->x - allocation.width + pizza->m_xoffset;
}
-
+
gtk_widget_size_allocate (child->widget, &allocation);
}
event.SetId( win->GetId() );
bool ret = win->GTKProcessEvent(event);
-
+
g_lastMouseEvent = NULL;
-
+
return ret;
}
SelectObject(destDC, (HBITMAP) m_maskBitmap);
BitBlt(destDC, 0, 0, w, h, srcDC, 0, 0, SRCCOPY);
-
+
SelectObject(srcDC, 0);
DeleteDC(srcDC);
SelectObject(destDC, 0);
int sizeFlags)
{
int heightOrig = height;
-
+
// the height which we must pass to Windows should be the total height of
// the control including the drop down list while the height given to us
// is, of course, just the height of the permanently visible part of it
{
if (SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0))
return false;
-
+
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
const int sel = GetSelection();
dumpFlags = (MINIDUMP_TYPE)(MiniDumpScanMemory
#if _MSC_VER > 1300
|MiniDumpWithIndirectlyReferencedMemory
-#endif
+#endif
);
}
void wxGLCanvas::SetCurrent(const wxGLContext& RC) const
{
// although on MSW it works even if the window is still hidden, it doesn't
- // under wxGTK and documentation mentions that SetCurrent() can only be
- // called for a shown window, so check it
- wxASSERT_MSG( GetParent()->IsShown(), _T("can't make hidden GL canvas current") );
+ // under wxGTK and documentation mentions that SetCurrent() can only be
+ // called for a shown window, so check it
+ wxASSERT_MSG( GetParent()->IsShown(), _T("can't make hidden GL canvas current") );
RC.SetCurrent(*this);
}
// gets the component valuess of the matrix
virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL,
wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
-
+
// makes this the inverse matrix
virtual void Invert();
result |= GSOCK_INPUT_FLAG;
if (m_server && m_stream)
- {
- /* This is a TCP server socket that detected a connection.
- While the INPUT_FLAG is also set, it doesn't matter on
+ {
+ /* This is a TCP server socket that detected a connection.
+ While the INPUT_FLAG is also set, it doesn't matter on
this kind of sockets, as we can only Accept() from them. */
result |= GSOCK_CONNECTION_FLAG;
m_detected |= GSOCK_CONNECTION_FLAG;
// where did the click occur?
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__) && _WIN32_WCE < 400
- if (nmhdr->code == GN_CONTEXTMENU)
+ if (nmhdr->code == GN_CONTEXTMENU)
{
*ptClick = ((NMRGINFO*)nmhdr)->ptAction;
- }
+ }
else
#endif //__WXWINCE__
if ( !::GetCursorPos(ptClick) )
} MENUINFO, FAR *LPMENUINFO;
#endif
-#if wxUSE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/dynlib.h"
#endif
!pItem->GetBackgroundColour().Ok() &&
!pItem->GetFont().Ok() )
{
- // try to use InsertMenuItem() as it's guaranteed to look correct
+ // try to use InsertMenuItem() as it's guaranteed to look correct
// while our owner-drawn code is not
-#ifndef __DMC__
+#ifndef __DMC__
// DMC at march 2007 doesn't have HBITMAP hbmpItem tagMENUITEMINFOA /W
// MIIM_BITMAP only works under WinME/2000+
WinStruct<MENUITEMINFO> mii;
if ( wxGetWinVersion() >= wxWinVersion_98 )
- {
+ {
mii.fMask = MIIM_STRING | MIIM_DATA | MIIM_BITMAP;
if ( pItem->IsCheckable() )
{
}
BOOL ScrollWindow(HWND hWnd, int xAmount, int yAmount,
- CONST RECT* lpRect, CONST RECT* lpClipRect)
+ CONST RECT* lpRect, CONST RECT* lpClipRect)
{
/* TODO */
return FALSE;
GdGetFontInfo(((MWFONTOBJ*) hFont)->pfont, &fi);
- /* FIXME many items are guessed for the time being*/
- logFont->lfHeight = fi.height;
+ /* FIXME many items are guessed for the time being*/
+ logFont->lfHeight = fi.height;
- /* reversed for kaffe port
- logFont->tmAscent = fi.height - fi.baseline;
- logFont->tmDescent= fi.baseline;
- */
+ /* reversed for kaffe port
+ logFont->tmAscent = fi.height - fi.baseline;
+ logFont->tmDescent= fi.baseline;
+ */
- logFont->lfWidth = fi.widths['x'];
- logFont->lfWeight = FW_NORMAL;
+ logFont->lfWidth = fi.widths['x'];
+ logFont->lfWeight = FW_NORMAL;
logFont->lfEscapement = 0;
logFont->lfOrientation = 0;
logFont->lfOutPrecision = OUT_OUTLINE_PRECIS;
logFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
logFont->lfQuality = DEFAULT_QUALITY;
- logFont->lfItalic = 0;
- logFont->lfUnderline = 0;
- logFont->lfStrikeOut = 0;
- /* note that win32 has the TMPF_FIXED_PITCH flags REVERSED...*/
- logFont->lfPitchAndFamily = fi.fixed?
- FF_DONTCARE: (FF_DONTCARE | TMPF_FIXED_PITCH);
- logFont->lfCharSet = OEM_CHARSET;
- /* TODO I don't know how to get the font name. May
- * test for different font classes.
+ logFont->lfItalic = 0;
+ logFont->lfUnderline = 0;
+ logFont->lfStrikeOut = 0;
+ /* note that win32 has the TMPF_FIXED_PITCH flags REVERSED...*/
+ logFont->lfPitchAndFamily = fi.fixed?
+ FF_DONTCARE: (FF_DONTCARE | TMPF_FIXED_PITCH);
+ logFont->lfCharSet = OEM_CHARSET;
+ /* TODO I don't know how to get the font name. May
+ * test for different font classes.
*/
logFont->lfFaceName[0] = 0;
#if 0
- strncpy(logFont->lfFaceName, ??, sizeof(logFont->lfFaceName));
+ strncpy(logFont->lfFaceName, ??, sizeof(logFont->lfFaceName));
#endif
return sz;
}
HBITMAP WINAPI
CreateCompatibleBitmap(HDC hdc, int nWidth, int nHeight)
{
- MWBITMAPOBJ * hbitmap;
- int size;
- int linelen;
+ MWBITMAPOBJ *hbitmap;
+ int size;
+ int linelen;
- if(!hdc)
- return NULL;
+ if(!hdc)
+ return NULL;
- nWidth = MWMAX(nWidth, 1);
- nHeight = MWMAX(nHeight, 1);
+ nWidth = MWMAX(nWidth, 1);
+ nHeight = MWMAX(nHeight, 1);
- /* calc memory allocation size and linelen from width and height*/
- if(!GdCalcMemGCAlloc(hdc->psd, nWidth, nHeight, 0, 0, &size, &linelen))
- return NULL;
+ /* calc memory allocation size and linelen from width and height*/
+ if(!GdCalcMemGCAlloc(hdc->psd, nWidth, nHeight, 0, 0, &size, &linelen))
+ return NULL;
- /* allocate gdi object*/
- hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
- if(!hbitmap)
- return NULL;
- hbitmap->hdr.type = OBJ_BITMAP;
- hbitmap->hdr.stockobj = FALSE;
- hbitmap->width = nWidth;
- hbitmap->height = nHeight;
+ /* allocate gdi object*/
+ hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
+ if(!hbitmap)
+ return NULL;
+ hbitmap->hdr.type = OBJ_BITMAP;
+ hbitmap->hdr.stockobj = FALSE;
+ hbitmap->width = nWidth;
+ hbitmap->height = nHeight;
- /* create compatible with hdc*/
- hbitmap->planes = hdc->psd->planes;
- hbitmap->bpp = hdc->psd->bpp;
- hbitmap->linelen = linelen;
- hbitmap->size = size;
+ /* create compatible with hdc*/
+ hbitmap->planes = hdc->psd->planes;
+ hbitmap->bpp = hdc->psd->bpp;
+ hbitmap->linelen = linelen;
+ hbitmap->size = size;
- return (HBRUSH)hbitmap;
+ return (HBRUSH)hbitmap;
}
#endif
HBITMAP WINAPI
CreateBitmap( int nWidth, int nHeight, int nPlanes, int bPP, LPCVOID lpData)
{
- MWBITMAPOBJ * hbitmap;
- int size;
- int linelen;
+ MWBITMAPOBJ *hbitmap;
+ int size;
+ int linelen;
- HDC hScreenDC;
+ HDC hScreenDC;
- hScreenDC = GetDC(NULL);
+ hScreenDC = GetDC(NULL);
- nWidth = MWMAX(nWidth, 1);
- nHeight = MWMAX(nHeight, 1);
+ nWidth = MWMAX(nWidth, 1);
+ nHeight = MWMAX(nHeight, 1);
- /* calc memory allocation size and linelen from width and height*/
- if(!GdCalcMemGCAlloc(hScreenDC->psd, nWidth, nHeight, nPlanes, bPP, &size, &linelen))
- {
- ReleaseDC(NULL, hScreenDC);
- return NULL;
- }
+ /* calc memory allocation size and linelen from width and height*/
+ if(!GdCalcMemGCAlloc(hScreenDC->psd, nWidth, nHeight, nPlanes, bPP, &size, &linelen))
+ {
ReleaseDC(NULL, hScreenDC);
-
- /* allocate gdi object*/
- hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
- if(!hbitmap)
- return NULL;
- hbitmap->hdr.type = OBJ_BITMAP;
- hbitmap->hdr.stockobj = FALSE;
- hbitmap->width = nWidth;
- hbitmap->height = nHeight;
-
- /* create with specified parameters */
- hbitmap->planes = nPlanes;
- hbitmap->bpp = bPP;
- hbitmap->linelen = linelen;
- hbitmap->size = size;
-
- /* TODO: copy data */
-
- return (HBRUSH)hbitmap;
+ return NULL;
+ }
+ ReleaseDC(NULL, hScreenDC);
+
+ /* allocate gdi object*/
+ hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
+ if(!hbitmap)
+ return NULL;
+ hbitmap->hdr.type = OBJ_BITMAP;
+ hbitmap->hdr.stockobj = FALSE;
+ hbitmap->width = nWidth;
+ hbitmap->height = nHeight;
+
+ /* create with specified parameters */
+ hbitmap->planes = nPlanes;
+ hbitmap->bpp = bPP;
+ hbitmap->linelen = linelen;
+ hbitmap->size = size;
+
+ /* TODO: copy data */
+
+ return (HBRUSH)hbitmap;
}
MSWDefWindowProc(WM_PAINT, (WPARAM)memdc.GetHDC(), 0);
- // For some reason in RTL mode, source offset has to be -1, otherwise the
+ // For some reason in RTL mode, source offset has to be -1, otherwise the
// right border (physical) remains unpainted.
const wxCoord ofs = dir == wxLayout_RightToLeft ? -1 : 0;
dc.Blit(ofs, 0, rc.right, rc.bottom, &memdc, ofs, 0);
{
DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette);
}
-
+
return true;
}
{
return ::GetPaletteEntries((HPALETTE) M_PALETTEDATA->m_hPalette, 0, 0, NULL );
}
-
+
return 0;
}
#endif
#include "wx/msw/printwin.h"
-#include "wx/msw/printdlg.h" // RJL used Windows dialog?s
+#include "wx/msw/printdlg.h"
#include "wx/msw/private.h"
#include <stdlib.h>
int logPPIPrinterX;
int logPPIPrinterY;
- wxRect paperRect;
+ wxRect paperRect;
if ( printerDC.Ok() )
{
logPPIPrinterX = ::GetDeviceCaps(dc, LOGPIXELSX);
logPPIPrinterY = ::GetDeviceCaps(dc, LOGPIXELSY);
- paperRect = printerDC.GetPaperRect();
+ paperRect = printerDC.GetPaperRect();
if ( logPPIPrinterX == 0 ||
logPPIPrinterY == 0 ||
logPPIPrinterX = 600;
logPPIPrinterY = 600;
- paperRect = wxRect(0, 0, printerXRes, printerYRes);
+ paperRect = wxRect(0, 0, printerXRes, printerYRes);
m_isOk = false;
}
m_pageWidth = printerXRes;
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
wxHeaderButtonParams* params = NULL);
virtual int GetHeaderButtonHeight(wxWindow *win);
-
+
virtual void DrawTreeItemButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
// NOTE: Using the theme to draw HP_HEADERSORTARROW doesn't do anything.
// Why? If this can be fixed then draw the sort arrows using the theme
// and then clear those flags before calling DrawHeaderButtonContents.
-
+
// Add any extras that are specified in flags and params
return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
}
{
return m_rendererNative.GetHeaderButtonHeight(win);
}
-
+
HRESULT hr;
int value = -1;
-
+
hr = wxUxThemeEngine::Get()->GetThemeMetric( hTheme,
NULL,
HP_HEADERITEM,
}
void wxSpinButton::NormalizeValue()
-{
+{
SetValue( GetValue() );
}
{
// if not set yet, have one column
m_maxRows = 1;
- SetRows(m_nButtons);
+ SetRows(m_nButtons);
}
InvalidateBestSize();
tool->SetNormalBitmap(bitmap);
Realize();
- }
+ }
}
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
tool->SetDisabledBitmap(bitmap);
Realize();
- }
+ }
}
// ----------------------------------------------------------------------------
switch (vk)
{
case VK_LBUTTON:
- if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_RBUTTON;
+ if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_RBUTTON;
break;
case VK_RBUTTON:
if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_LBUTTON;