本文整理汇总了C++中MAC_WXHWND函数的典型用法代码示例。如果您正苦于以下问题:C++ MAC_WXHWND函数的具体用法?C++ MAC_WXHWND怎么用?C++ MAC_WXHWND使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAC_WXHWND函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WXUNUSED
wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
wxWindowMac* parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long WXUNUSED(style),
long WXUNUSED(extraStyle))
{
OSStatus err;
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
wxMacControl* peer = new wxMacControl(wxpeer) ;
if ( id == wxID_HELP )
{
ControlButtonContentInfo info ;
info.contentType = kControlContentIconRef ;
GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &info.u.iconRef);
err = CreateRoundButtonControl(
MAC_WXHWND(parent->MacGetTopLevelWindowRef()),
&bounds, kControlRoundButtonNormalSize,
&info, peer->GetControlRefAddr() );
}
else if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND)
{
// Button height is static in Mac, can't be changed, so we need to force it here
int maxHeight;
switch (wxpeer->GetWindowVariant() )
{
default:
wxFAIL_MSG( "unknown window variant" );
// fall through
case wxWINDOW_VARIANT_NORMAL:
case wxWINDOW_VARIANT_LARGE:
maxHeight = 20 ;
break;
case wxWINDOW_VARIANT_SMALL:
maxHeight = 17;
break;
case wxWINDOW_VARIANT_MINI:
maxHeight = 15;
}
bounds.bottom = bounds.top + maxHeight ;
wxpeer->SetMaxSize( wxSize( wxpeer->GetMaxWidth() , maxHeight ));
err = CreatePushButtonControl(
MAC_WXHWND(parent->MacGetTopLevelWindowRef()),
&bounds, CFSTR(""), peer->GetControlRefAddr() );
}
else
{
ControlButtonContentInfo info ;
info.contentType = kControlNoContent ;
err = CreateBevelButtonControl(
MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds, CFSTR(""),
kControlBevelButtonLargeBevel, kControlBehaviorPushbutton,
&info, 0, 0, 0, peer->GetControlRefAddr() );
}
verify_noerr( err );
return peer;
}
示例2: while
void wxGLCanvas::SetViewport()
{
// viewport is initially set to entire port
// adjust glViewport to just this window
int x = 0 ;
int y = 0 ;
wxWindow* iter = this ;
while( iter->GetParent() )
{
iter = iter->GetParent() ;
}
if ( iter && iter->IsTopLevel() )
{
MacClientToRootWindow( &x , &y ) ;
int width, height;
GetClientSize(& width, & height);
Rect bounds ;
GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ;
GLint parms[4] ;
parms[0] = x ;
parms[1] = bounds.bottom - bounds.top - ( y + height ) ;
parms[2] = width ;
parms[3] = height ;
if ( !m_macCanvasIsShown )
parms[0] += 20000 ;
aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
}
}
示例3: wxMacGetBoundsForControl
bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
m_macIsUserPane = FALSE ;
if ( !wxControl::Create(parent, id, pos, size,
style, wxDefaultValidator, name) )
return false;
m_label = label ;
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
m_peer = new wxMacControl(this) ;
verify_noerr(CreateGroupBoxControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, CFSTR("") ,
true /*primary*/ , m_peer->GetControlRefAddr() ) ) ;
MacPostControlCreate(pos,size) ;
return TRUE;
}
示例4: wxStripMenuCodes
bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
m_macIsUserPane = FALSE ;
m_label = wxStripMenuCodes(label) ;
if ( !wxControl::Create( parent, id, pos, size, style,
wxDefaultValidator , name ) )
{
return false;
}
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
wxMacCFStringHolder str(m_label,m_font.GetEncoding() ) ;
m_peer = new wxMacControl(this) ;
verify_noerr(CreateStaticTextControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, str ,
NULL , m_peer->GetControlRefAddr() ) ) ;
MacPostControlCreate(pos,size) ;
return true;
}
示例5: WXUNUSED
wxWidgetImplType* wxWidgetImpl::CreateSlider( wxWindowMac* wxpeer,
wxWindowMac* parent,
wxWindowID WXUNUSED(id),
wxInt32 value,
wxInt32 minimum,
wxInt32 maximum,
const wxPoint& pos,
const wxSize& size,
long style,
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
int tickMarks = 0;
if ( style & wxSL_AUTOTICKS )
tickMarks = (maximum - minimum) + 1; // +1 for the 0 value
// keep the number of tickmarks from becoming unwieldly, therefore below it is ok to cast
// it to a UInt16
while (tickMarks > 20)
tickMarks /= 5;
wxMacControl* peer = new wxMacSliderCarbonControl( wxpeer );
OSStatus err = CreateSliderControl(
MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
value, minimum, maximum,
kControlSliderPointsDownOrRight,
(UInt16) tickMarks, true /* liveTracking */,
GetwxMacLiveScrollbarActionProc(),
peer->GetControlRefAddr() );
verify_noerr( err );
return peer;
}
示例6: WXUNUSED
wxMacDataBrowserControl::wxMacDataBrowserControl( wxWindow* peer,
const wxPoint& pos,
const wxSize& size,
long WXUNUSED(style))
: wxMacControl( peer )
{
Rect bounds = wxMacGetBoundsForControl( peer, pos, size );
OSStatus err = ::CreateDataBrowserControl(
MAC_WXHWND(peer->MacGetTopLevelWindowRef()),
&bounds, kDataBrowserListView, &m_controlRef );
SetReferenceInNativeControl();
verify_noerr( err );
if ( gDataBrowserItemCompareUPP == NULL )
gDataBrowserItemCompareUPP = NewDataBrowserItemCompareUPP(DataBrowserCompareProc);
if ( gDataBrowserItemDataUPP == NULL )
gDataBrowserItemDataUPP = NewDataBrowserItemDataUPP(DataBrowserGetSetItemDataProc);
if ( gDataBrowserItemNotificationUPP == NULL )
{
gDataBrowserItemNotificationUPP =
(DataBrowserItemNotificationUPP) NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationProc);
}
DataBrowserCallbacks callbacks;
InitializeDataBrowserCallbacks( &callbacks, kDataBrowserLatestCallbacks );
callbacks.u.v1.itemDataCallback = gDataBrowserItemDataUPP;
callbacks.u.v1.itemCompareCallback = gDataBrowserItemCompareUPP;
callbacks.u.v1.itemNotificationCallback = gDataBrowserItemNotificationUPP;
SetCallbacks( &callbacks );
}
示例7: WXUNUSED
wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer,
wxWindowMac* parent,
wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(label),
const wxPoint& pos,
const wxSize& size,
long style,
long WXUNUSED(extraStyle))
{
Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
wxMacControl* peer = new wxMacStaticText( wxpeer );
OSStatus err = CreateStaticTextControl(
MAC_WXHWND(parent->MacGetTopLevelWindowRef()),
&bounds, NULL, NULL, peer->GetControlRefAddr() );
verify_noerr( err );
if ( ( style & wxST_ELLIPSIZE_END ) || ( style & wxST_ELLIPSIZE_MIDDLE ) )
{
TruncCode tCode = truncEnd;
if ( style & wxST_ELLIPSIZE_MIDDLE )
tCode = truncMiddle;
err = peer->SetData( kControlStaticTextTruncTag, tCode );
err = peer->SetData( kControlStaticTextIsMultilineTag, (Boolean)0 );
}
return peer;
}
示例8: if
void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event )
{
if ( s_ShowToolTips )
{
if ( event.GetEventType() == wxEVT_LEAVE_WINDOW )
{
s_ToolTip.Clear() ;
}
else if (event.GetEventType() == wxEVT_ENTER_WINDOW || event.GetEventType() == wxEVT_MOTION )
{
wxPoint2DInt where( event.m_x , event.m_y ) ;
if ( s_LastWindowEntered == win && s_ToolTipArea.Contains( where ) )
{
}
else
{
s_ToolTip.Clear() ;
s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ;
s_LastWindowEntered = win ;
WindowRef window = MAC_WXHWND( win->MacGetTopLevelWindowRef() ) ;
int x = event.m_x ;
int y = event.m_y ;
wxPoint local( x , y ) ;
win->MacClientToRootWindow( &x, &y ) ;
wxPoint windowlocal( x , y ) ;
s_ToolTip.Setup( window , win->MacGetToolTipString( local ) , windowlocal ) ;
}
}
}
}
示例9: wxSize
bool wxGauge::Create(wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos,
const wxSize& s,
long style,
const wxValidator& validator,
const wxString& name)
{
if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) )
return false;
wxSize size = s ;
Rect bounds ;
Str255 title ;
m_rangeMax = range ;
m_gaugePos = 0 ;
if ( size.x == wxDefaultCoord && size.y == wxDefaultCoord)
{
size = wxSize( 200 , 16 ) ;
}
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
kControlProgressBarProc , (long) this ) ;
MacPostControlCreate() ;
return true;
}
示例10: aglSetInteger
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
{
if ( !m_glContext )
return false;
GLint bufnummer = win.GetAglBufferName();
aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer);
//win.SetLastContext(m_glContext);
const_cast<wxGLCanvas&>(win).SetViewport();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( UMAGetSystemVersion() >= 0x1050 )
{
aglSetWindowRef(m_glContext, win.MacGetTopLevelWindowRef());
}
else
#endif
{
AGLDrawable drawable = (AGLDrawable)GetWindowPort(
MAC_WXHWND(win.MacGetTopLevelWindowRef()));
if ( !aglSetDrawable(m_glContext, drawable) )
{
wxLogAGLError("aglSetDrawable");
return false;
}
}
return WXGLSetCurrentContext(m_glContext);
}
示例11: UMAGetWindowPort
wxGLContext::wxGLContext(
AGLPixelFormat fmt, wxGLCanvas *win,
const wxPalette& palette,
const wxGLContext *other /* for sharing display lists */
)
{
m_window = win;
#ifndef __LP64__
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef()));
#endif
m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
GLboolean b;
#ifndef __LP64__
b = aglSetDrawable(m_glContext, m_drawable);
aglEnable(m_glContext , AGL_BUFFER_RECT ) ;
#else
b = aglSetHIViewRef(m_glContext, (HIViewRef) win->GetHandle());
#endif
wxCHECK_RET( b, wxT("Couldn't bind OpenGl context") );
b = aglSetCurrentContext(m_glContext);
wxCHECK_RET( b, wxT("Couldn't activate OpenGl context") );
}
示例12: wxMacGetBoundsForControl
// Single check box item
bool wxCheckBox::Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
m_macIsUserPane = false ;
if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
return false;
m_label = label ;
SInt32 maxValue = 1 /* kControlCheckboxCheckedValue */;
if (style & wxCHK_3STATE)
maxValue = 2 /* kControlCheckboxMixedValue */;
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
m_peer = new wxMacControl( this ) ;
verify_noerr( CreateCheckBoxControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds ,
CFSTR("") , 0 , false , m_peer->GetControlRefAddr() ) );
m_peer->SetMaximum( maxValue ) ;
MacPostControlCreate(pos, size) ;
return true;
}
示例13: MacPreControlCreate
// Single check box item
bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
const wxString& name)
{
if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
return false;
Rect bounds ;
Str255 title ;
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
SInt16 maxValue = 1 /* kControlCheckboxCheckedValue */;
if (style & wxCHK_3STATE)
{
maxValue = 2 /* kControlCheckboxMixedValue */;
}
m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue,
kControlCheckBoxProc , (long) this ) ;
MacPostControlCreate() ;
return TRUE;
}
示例14: WXUNUSED
bool wxGLCanvas::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name,
const int *attribList,
const wxPalette& WXUNUSED(palette))
{
m_needsUpdate = false;
m_macCanvasIsShown = false;
m_glFormat = WXGLChoosePixelFormat(attribList);
if ( !m_glFormat )
return false;
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
return false;
m_dummyContext = WXGLCreateContext(m_glFormat, NULL);
static GLint gCurrentBufferName = 1;
m_bufferName = gCurrentBufferName++;
aglSetInteger (m_dummyContext, AGL_BUFFER_NAME, &m_bufferName);
AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
aglSetDrawable(m_dummyContext, drawable);
m_macCanvasIsShown = true;
return true;
}
示例15: GetFieldRect
void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
{
int leftMargin = 2;
wxRect rect;
GetFieldRect(i, rect);
if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
{
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
}
wxString text(GetStatusText(i));
long x, y;
dc.GetTextExtent(text, &x, &y);
int xpos = rect.x + leftMargin + 1 ;
int ypos = 1 ;
dc.SetClippingRegion(rect.x, 0, rect.width, m_height);
dc.DrawText(text, xpos, ypos);
dc.DestroyClippingRegion();
}