本文整理汇总了C++中UseNative函数的典型用法代码示例。如果您正苦于以下问题:C++ UseNative函数的具体用法?C++ UseNative怎么用?C++ UseNative使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UseNative函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowMessage
void wxInfoBar::ShowMessage(const wxString& msg, int flags)
{
if ( !UseNative() )
{
wxInfoBarGeneric::ShowMessage(msg, flags);
return;
}
// if we don't have any buttons, create a standard close one to give the
// user at least some way to close the bar
if ( m_impl->m_buttons.empty() && !m_impl->m_close )
{
m_impl->m_close = GTKAddButton(wxID_CLOSE);
}
GtkMessageType type;
if ( wxGTKImpl::ConvertMessageTypeFromWX(flags, &type) )
gtk_info_bar_set_message_type(GTK_INFO_BAR(m_widget), type);
gtk_label_set_text(GTK_LABEL(m_impl->m_label), wxGTK_CONV(msg));
if ( !IsShown() )
Show();
UpdateParent();
}
示例2: HasButtonId
bool wxInfoBar::HasButtonId(wxWindowID btnid) const
{
if ( !UseNative() )
return wxInfoBarGeneric::HasButtonId(btnid);
// as in the generic version, look for the button starting from the end
const wxInfoBarGTKImpl::Buttons& buttons = m_impl->m_buttons;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for ( wxInfoBarGTKImpl::Buttons::const_reverse_iterator i = buttons.rbegin();
i != buttons.rend();
++i )
{
if ( i->id == btnid )
return true;
}
return false;
}
示例3: DoApplyWidgetStyle
void wxInfoBar::DoApplyWidgetStyle(GtkRcStyle *style)
{
wxInfoBarGeneric::DoApplyWidgetStyle(style);
if ( UseNative() )
GTKApplyStyle(m_impl->m_label, style);
}
示例4: DoApplyWidgetStyle
void wxInfoBar::DoApplyWidgetStyle(GtkRcStyle *style)
{
wxInfoBarGeneric::DoApplyWidgetStyle(style);
if ( UseNative() )
gtk_widget_modify_style(m_impl->m_label, style);
}
示例5: SetURL
void wxHyperlinkCtrl::SetURL(const wxString &uri)
{
if ( UseNative() )
gtk_link_button_set_uri(GTK_LINK_BUTTON(m_widget), wxGTK_CONV(uri));
else
wxGenericHyperlinkCtrl::SetURL(uri);
}
示例6: GetButtonCount
size_t wxInfoBar::GetButtonCount() const
{
if ( !UseNative() )
return wxInfoBarGeneric::GetButtonCount();
return m_impl->m_buttons.size();
}
示例7: RemoveButton
void wxInfoBar::RemoveButton(wxWindowID btnid)
{
if ( !UseNative() )
{
wxInfoBarGeneric::RemoveButton(btnid);
return;
}
// as in the generic version, look for the button starting from the end
wxInfoBarGTKImpl::Buttons& buttons = m_impl->m_buttons;
for ( wxInfoBarGTKImpl::Buttons::reverse_iterator i = buttons.rbegin();
i != buttons.rend();
++i )
{
if (i->id == btnid)
{
gtk_widget_destroy(i->button);
buttons.erase(i.base());
// see comment in GTKAddButton()
InvalidateBestSize();
return;
}
}
wxFAIL_MSG( wxString::Format("button with id %d not found", btnid) );
}
示例8: SetHoverColour
void wxHyperlinkCtrl::SetHoverColour(const wxColour &colour)
{
if ( UseNative() )
{
// simply do nothing: GTK+ does not allow us to change it :(
}
else
wxGenericHyperlinkCtrl::SetHoverColour(colour);
}
示例9: GetHoverColour
wxColour wxHyperlinkCtrl::GetHoverColour() const
{
if ( UseNative() )
{
// hover colour == normal colour for native GTK+ widget
return GetNormalColour();
}
return wxGenericHyperlinkCtrl::GetHoverColour();
}
示例10: GetURL
wxString wxHyperlinkCtrl::GetURL() const
{
if ( UseNative() )
{
const gchar *str = gtk_link_button_get_uri(GTK_LINK_BUTTON(m_widget));
return wxString::FromUTF8(str);
}
return wxGenericHyperlinkCtrl::GetURL();
}
示例11: GetButtonId
wxWindowID wxInfoBar::GetButtonId(size_t idx) const
{
if ( !UseNative() )
return wxInfoBarGeneric::GetButtonId(idx);
wxCHECK_MSG( idx < m_impl->m_buttons.size(), wxID_NONE,
"Invalid infobar button position" );
return m_impl->m_buttons[idx].id;
}
示例12: SetLabel
void wxHyperlinkCtrl::SetLabel(const wxString &label)
{
if ( UseNative() )
{
wxControl::SetLabel(label);
const wxString labelGTK = GTKConvertMnemonics(label);
gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK));
}
else
wxGenericHyperlinkCtrl::SetLabel(label);
}
示例13: Dismiss
void wxInfoBar::Dismiss()
{
if ( !UseNative() )
{
wxInfoBarGeneric::Dismiss();
return;
}
Hide();
UpdateParent();
}
示例14: Create
bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id,
const wxString& label, const wxString& url, const wxPoint& pos,
const wxSize& size, long style, const wxString& name)
{
if ( UseNative() )
{
// do validation checks:
CheckParams(label, url, style);
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxHyperlinkCtrl creation failed") );
return false;
}
m_widget = gtk_link_button_new("asdfsaf asdfdsaf asdfdsa");
g_object_ref(m_widget);
gtk_widget_show(m_widget);
// alignment
float x_alignment = 0.5;
if (HasFlag(wxHL_ALIGN_LEFT))
x_alignment = 0.0;
else if (HasFlag(wxHL_ALIGN_RIGHT))
x_alignment = 1.0;
gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, 0.5);
// set to non empty strings both the url and the label
SetURL(url.empty() ? label : url);
SetLabel(label.empty() ? url : label);
// our signal handlers:
g_signal_connect_after (m_widget, "clicked",
G_CALLBACK (gtk_hyperlink_clicked_callback),
this);
m_parent->DoAddChild( this );
PostCreation(size);
SetInitialSize(size);
// 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:
SetCursor(wxCursor(wxCURSOR_HAND));
}
else
return wxGenericHyperlinkCtrl::Create(parent, id, label, url, pos, size, style, name);
return true;
}
示例15: HasButtonId
bool wxInfoBar::HasButtonId(wxWindowID btnid) const
{
if ( !UseNative() )
return wxInfoBarGeneric::HasButtonId(btnid);
// as in the generic version, look for the button starting from the end
const wxInfoBarGTKImpl::Buttons& buttons = m_impl->m_buttons;
for ( wxInfoBarGTKImpl::Buttons::const_reverse_iterator i = buttons.rbegin();
i != buttons.rend();
++i )
{
if ( i->id == btnid )
return true;
}
return false;
}