本文整理汇总了C++中wxCursor::Ok方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCursor::Ok方法的具体用法?C++ wxCursor::Ok怎么用?C++ wxCursor::Ok使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCursor
的用法示例。
在下文中一共展示了wxCursor::Ok方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInternalIdle
void wxCheckBox::OnInternalIdle()
{
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
GdkWindow *event_window = TOGGLE_BUTTON_EVENT_WIN(m_widgetCheckbox);
if ( event_window && cursor.Ok() )
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
gdk_window_set_cursor( event_window, cursor.GetCursor() );
}
if (g_delayedFocus == this)
{
if (GTK_WIDGET_REALIZED(m_widget))
{
gtk_widget_grab_focus( m_widget );
g_delayedFocus = NULL;
}
}
if (wxUpdateUIEvent::CanUpdate(this))
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
示例2: wxSetCursor
// Global cursor setting
void wxSetCursor(const wxCursor& cursor)
{
extern wxCursor *g_globalCursor;
if ( cursor.Ok() && cursor.GetHCURSOR() )
{
// ::SetCursor((HCURSOR) cursor.GetHCURSOR());
if ( g_globalCursor )
(*g_globalCursor) = cursor;
}
}
示例3: wxBeginBusyCursor
void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) )
{
if (gs_busyCount++ > 0)
return;
wxASSERT_MSG( !gs_savedCursor.Ok(),
wxT("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
wxSetCursor( wxCursor(wxCURSOR_WATCH) );
if (wxTheApp)
wxTheApp->ProcessIdle();
}
示例4: OnInternalIdle
void wxTextCtrl::OnInternalIdle()
{
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok())
{
GdkWindow *window = NULL;
if (HasFlag(wxTE_MULTILINE))
window = GTK_TEXT(m_text)->text_area;
else
window = GTK_ENTRY(m_text)->text_area;
if (window)
gdk_window_set_cursor( window, cursor.GetCursor() );
if (!g_globalCursor.Ok())
cursor = *wxSTANDARD_CURSOR;
window = m_widget->window;
if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
gdk_window_set_cursor( window, cursor.GetCursor() );
}
if (g_delayedFocus == this)
{
if (GTK_WIDGET_REALIZED(m_widget))
{
gtk_widget_grab_focus( m_widget );
g_delayedFocus = NULL;
}
}
if (wxUpdateUIEvent::CanUpdate(this))
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
示例5: OnInternalIdle
void wxToolBar::OnInternalIdle()
{
// Check if we have to show window now
if (GTKShowFromOnIdle()) return;
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (cursor.Ok())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (HasFlag(wxTB_DOCKABLE) && (m_widget->window))
{
/* if the toolbar is dockable, then m_widget stands for the
GtkHandleBox widget, which uses its own window so that we
can set the cursor for it. if the toolbar is not dockable,
m_widget comes from m_toolbar which uses its parent's
window ("windowless windows") and thus we cannot set the
cursor. */
gdk_window_set_cursor( m_widget->window, cursor.GetCursor() );
}
wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
while ( node )
{
wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
node = node->GetNext();
if (tool->m_item)
{
GdkWindow* window = GTK_WIDGET(tool->m_item)->window;
if ( window )
{
gdk_window_set_cursor( window, cursor.GetCursor() );
}
}
}
}
if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
示例6: OnInternalIdle
void wxListBox::OnInternalIdle()
{
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;
if (GTK_WIDGET(m_list)->window && cursor.Ok())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
gdk_window_set_cursor( GTK_WIDGET(m_list)->window, cursor.GetCursor() );
GList *child = m_list->children;
while (child)
{
GtkBin *bin = GTK_BIN( child->data );
GtkWidget *label = GTK_WIDGET( bin->child );
if (!label->window)
break;
else
gdk_window_set_cursor( label->window, cursor.GetCursor() );
child = child->next;
}
}
if (g_delayedFocus == this)
{
if (GTK_WIDGET_REALIZED(m_widget))
{
gtk_widget_grab_focus( m_widget );
g_delayedFocus = NULL;
}
}
if (wxUpdateUIEvent::CanUpdate(this))
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}