Applied patch #881258: Add wxT() to debug messages and a few others
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -27,11 +27,11 @@ public:
|
|||||||
, m_style(wxNORMAL)
|
, m_style(wxNORMAL)
|
||||||
, m_weight(wxNORMAL)
|
, m_weight(wxNORMAL)
|
||||||
, m_underlined(FALSE)
|
, m_underlined(FALSE)
|
||||||
, m_faceName("Geneva")
|
, m_faceName(wxT("Geneva"))
|
||||||
, m_encoding(wxFONTENCODING_DEFAULT)
|
, m_encoding(wxFONTENCODING_DEFAULT)
|
||||||
{
|
{
|
||||||
Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
|
Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
|
||||||
"Geneva", wxFONTENCODING_DEFAULT);
|
wxT("Geneva"), wxFONTENCODING_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFontRefData(const wxFontRefData& data)
|
wxFontRefData(const wxFontRefData& data)
|
||||||
|
@@ -47,9 +47,9 @@ WX_IMPLEMENT_POSER(wxPoserNSButton);
|
|||||||
@implementation wxPoserNSButton : NSButton
|
@implementation wxPoserNSButton : NSButton
|
||||||
- (void)wxNSButtonAction: (id)sender
|
- (void)wxNSButtonAction: (id)sender
|
||||||
{
|
{
|
||||||
wxASSERT_MSG((id)self==sender,"Received wxNSButtonAction from another object");
|
wxASSERT_MSG((id)self==sender,wxT("Received wxNSButtonAction from another object"));
|
||||||
wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self);
|
wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self);
|
||||||
wxCHECK_RET(button,"wxNSButtonAction received without associated wx object");
|
wxCHECK_RET(button,wxT("wxNSButtonAction received without associated wx object"));
|
||||||
button->Cocoa_wxNSButtonAction();
|
button->Cocoa_wxNSButtonAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,9 +40,9 @@
|
|||||||
|
|
||||||
- (void)wxNSControlAction: (id)sender
|
- (void)wxNSControlAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug("wxNSControlAction");
|
wxLogDebug(wxT("wxNSControlAction"));
|
||||||
wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
|
wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(wxcontrol,"wxNSControlAction received but no wxCocoaNSControl exists!");
|
wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!"));
|
||||||
wxcontrol->CocoaTarget_action();
|
wxcontrol->CocoaTarget_action();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,35 +58,35 @@ struct objc_object *wxCocoaNSMenu::sm_cocoaObserver = [[wxNSMenuNotificationObse
|
|||||||
- (void)menuDidAddItem: (NSNotification *)notification
|
- (void)menuDidAddItem: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(menu,"menuDidAddItem received but no wxMenu exists");
|
wxCHECK_RET(menu,wxT("menuDidAddItem received but no wxMenu exists"));
|
||||||
menu->CocoaNotification_menuDidAddItem(notification);
|
menu->CocoaNotification_menuDidAddItem(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)menuDidChangeItem: (NSNotification *)notification
|
- (void)menuDidChangeItem: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(menu,"menuDidChangeItem received but no wxMenu exists");
|
wxCHECK_RET(menu,wxT("menuDidChangeItem received but no wxMenu exists"));
|
||||||
menu->CocoaNotification_menuDidChangeItem(notification);
|
menu->CocoaNotification_menuDidChangeItem(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)menuDidRemoveItem: (NSNotification *)notification
|
- (void)menuDidRemoveItem: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(menu,"menuDidRemoveItem received but no wxMenu exists");
|
wxCHECK_RET(menu,wxT("menuDidRemoveItem received but no wxMenu exists"));
|
||||||
menu->CocoaNotification_menuDidRemoveItem(notification);
|
menu->CocoaNotification_menuDidRemoveItem(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)menuDidSendAction: (NSNotification *)notification
|
- (void)menuDidSendAction: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(menu,"menuDidSendAction received but no wxMenu exists");
|
wxCHECK_RET(menu,wxT("menuDidSendAction received but no wxMenu exists"));
|
||||||
menu->CocoaNotification_menuDidSendAction(notification);
|
menu->CocoaNotification_menuDidSendAction(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)menuWillSendAction: (NSNotification *)notification
|
- (void)menuWillSendAction: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(menu,"menuWillSendAction received but no wxMenu exists");
|
wxCHECK_RET(menu,wxT("menuWillSendAction received but no wxMenu exists"));
|
||||||
menu->CocoaNotification_menuWillSendAction(notification);
|
menu->CocoaNotification_menuWillSendAction(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTableView)
|
|||||||
- (int)numberOfRowsInTableView: (NSTableView *)tableView
|
- (int)numberOfRowsInTableView: (NSTableView *)tableView
|
||||||
{
|
{
|
||||||
wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
|
wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
|
||||||
wxCHECK_MSG(wxView, 0, "No associated wx object");
|
wxCHECK_MSG(wxView, 0, wxT("No associated wx object"));
|
||||||
return wxView->CocoaDataSource_numberOfRows();
|
return wxView->CocoaDataSource_numberOfRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTableView)
|
|||||||
row: (int)rowIndex
|
row: (int)rowIndex
|
||||||
{
|
{
|
||||||
wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
|
wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
|
||||||
wxCHECK_MSG(wxView, nil, "No associated wx object");
|
wxCHECK_MSG(wxView, nil, wxT("No associated wx object"));
|
||||||
return wxView->CocoaDataSource_objectForTableColumn(tableColumn,rowIndex);
|
return wxView->CocoaDataSource_objectForTableColumn(tableColumn,rowIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -189,7 +189,7 @@ void *wxCocoaNSView::sm_cocoaObserver = [[wxNSViewNotificationObserver alloc] in
|
|||||||
- (void)notificationFrameChanged: (NSNotification *)notification;
|
- (void)notificationFrameChanged: (NSNotification *)notification;
|
||||||
{
|
{
|
||||||
wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa([notification object]);
|
wxCocoaNSView *win = wxCocoaNSView::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"notificationFrameChanged received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("notificationFrameChanged received but no wxWindow exists"));
|
||||||
win->Cocoa_FrameChanged();
|
win->Cocoa_FrameChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,48 +50,48 @@
|
|||||||
- (void)windowDidBecomeKey: (NSNotification *)notification
|
- (void)windowDidBecomeKey: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"notificationDidBecomeKey received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("notificationDidBecomeKey received but no wxWindow exists"));
|
||||||
win->CocoaDelegate_windowDidBecomeKey();
|
win->CocoaDelegate_windowDidBecomeKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignKey: (NSNotification *)notification
|
- (void)windowDidResignKey: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"notificationDidResignKey received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("notificationDidResignKey received but no wxWindow exists"));
|
||||||
win->CocoaDelegate_windowDidResignKey();
|
win->CocoaDelegate_windowDidResignKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain: (NSNotification *)notification
|
- (void)windowDidBecomeMain: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"notificationDidBecomeMain received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("notificationDidBecomeMain received but no wxWindow exists"));
|
||||||
win->CocoaDelegate_windowDidBecomeMain();
|
win->CocoaDelegate_windowDidBecomeMain();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignMain: (NSNotification *)notification
|
- (void)windowDidResignMain: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"notificationDidResignMain received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("notificationDidResignMain received but no wxWindow exists"));
|
||||||
win->CocoaDelegate_windowDidResignMain();
|
win->CocoaDelegate_windowDidResignMain();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)windowShouldClose: (id)sender
|
- (BOOL)windowShouldClose: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug("windowShouldClose");
|
wxLogDebug(wxT("windowShouldClose"));
|
||||||
wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender);
|
wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender);
|
||||||
if(tlw && !tlw->CocoaDelegate_windowShouldClose())
|
if(tlw && !tlw->CocoaDelegate_windowShouldClose())
|
||||||
{
|
{
|
||||||
wxLogDebug("Window will not be closed");
|
wxLogDebug(wxT("Window will not be closed"));
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
wxLogDebug("Window will be closed");
|
wxLogDebug(wxT("Window will be closed"));
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowWillClose: (NSNotification *)notification
|
- (void)windowWillClose: (NSNotification *)notification
|
||||||
{
|
{
|
||||||
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]);
|
||||||
wxCHECK_RET(win,"windowWillClose received but no wxWindow exists");
|
wxCHECK_RET(win,wxT("windowWillClose received but no wxWindow exists"));
|
||||||
win->CocoaDelegate_windowWillClose();
|
win->CocoaDelegate_windowWillClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication);
|
|||||||
&& ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode]))
|
&& ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode]))
|
||||||
{
|
{
|
||||||
sg_needIdle = false;
|
sg_needIdle = false;
|
||||||
wxLogDebug("Processing idle events");
|
wxLogDebug(wxT("Processing idle events"));
|
||||||
while(wxTheApp->ProcessIdle())
|
while(wxTheApp->ProcessIdle())
|
||||||
{
|
{
|
||||||
// Get the same events except don't block
|
// Get the same events except don't block
|
||||||
@@ -97,19 +97,19 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication);
|
|||||||
if(event)
|
if(event)
|
||||||
return event;
|
return event;
|
||||||
// we didn't get one, do some idle work
|
// we didn't get one, do some idle work
|
||||||
wxLogDebug("Looping idle events");
|
wxLogDebug(wxT("Looping idle events"));
|
||||||
}
|
}
|
||||||
// No more idle work requested, block
|
// No more idle work requested, block
|
||||||
wxLogDebug("Finished idle processing");
|
wxLogDebug(wxT("Finished idle processing"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxLogDebug("Avoiding idle processing sg_needIdle=%d",sg_needIdle);
|
wxLogDebug(wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle);
|
||||||
return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag];
|
return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendEvent: (NSEvent*)anEvent
|
- (void)sendEvent: (NSEvent*)anEvent
|
||||||
{
|
{
|
||||||
wxLogDebug("SendEvent");
|
wxLogDebug(wxT("SendEvent"));
|
||||||
sg_needIdle = true;
|
sg_needIdle = true;
|
||||||
[super sendEvent: anEvent];
|
[super sendEvent: anEvent];
|
||||||
}
|
}
|
||||||
|
@@ -296,7 +296,7 @@ bool wxBitmap::Create(int w, int h, int d)
|
|||||||
bytesPerRow: 0
|
bytesPerRow: 0
|
||||||
bitsPerPixel: 0];
|
bitsPerPixel: 0];
|
||||||
|
|
||||||
wxLogDebug("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p", M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]);
|
wxLogDebug(wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]);
|
||||||
M_BITMAPDATA->m_ok = true;
|
M_BITMAPDATA->m_ok = true;
|
||||||
M_BITMAPDATA->m_numColors = 0;
|
M_BITMAPDATA->m_numColors = 0;
|
||||||
M_BITMAPDATA->m_quality = 0;
|
M_BITMAPDATA->m_quality = 0;
|
||||||
@@ -510,7 +510,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
|
|||||||
template <class PixelData>
|
template <class PixelData>
|
||||||
static bool wxMask_CreateFromBitmapData(PixelData srcData, const wxColour& colour, unsigned char *dstData)
|
static bool wxMask_CreateFromBitmapData(PixelData srcData, const wxColour& colour, unsigned char *dstData)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG(dstData,false,"Couldn't access mask data");
|
wxCHECK_MSG(dstData,false,wxT("Couldn't access mask data"));
|
||||||
class PixelData::Iterator p(srcData);
|
class PixelData::Iterator p(srcData);
|
||||||
const int nRows = srcData.GetHeight();
|
const int nRows = srcData.GetHeight();
|
||||||
const int nCols = srcData.GetWidth();
|
const int nCols = srcData.GetWidth();
|
||||||
@@ -581,7 +581,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
|||||||
|
|
||||||
// We need the source NSBitmapImageRep to detemine its pixel format
|
// We need the source NSBitmapImageRep to detemine its pixel format
|
||||||
NSBitmapImageRep *srcBitmapRep = const_cast<wxBitmap&>(bitmap).GetNSBitmapImageRep();
|
NSBitmapImageRep *srcBitmapRep = const_cast<wxBitmap&>(bitmap).GetNSBitmapImageRep();
|
||||||
wxCHECK_MSG(srcBitmapRep,false,"Can't create mask for an uninitialized bitmap");
|
wxCHECK_MSG(srcBitmapRep,false,wxT("Can't create mask for an uninitialized bitmap"));
|
||||||
|
|
||||||
// Get a pointer to the destination data
|
// Get a pointer to the destination data
|
||||||
unsigned char *dstPlanes[5] = {NULL,NULL,NULL,NULL,NULL};
|
unsigned char *dstPlanes[5] = {NULL,NULL,NULL,NULL,NULL};
|
||||||
@@ -592,7 +592,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
|||||||
{
|
{
|
||||||
wxPixelData<wxBitmap,wxNativePixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
wxPixelData<wxBitmap,wxNativePixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
||||||
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
||||||
false, "Unable to access raw data");
|
false, wxT("Unable to access raw data"));
|
||||||
}
|
}
|
||||||
// 32-bpp RGBx (x=throw away, no alpha)
|
// 32-bpp RGBx (x=throw away, no alpha)
|
||||||
else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==3 && [srcBitmapRep hasAlpha]==NO)
|
else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==3 && [srcBitmapRep hasAlpha]==NO)
|
||||||
@@ -600,17 +600,17 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
|||||||
typedef wxPixelFormat<unsigned char,32,0,1,2> PixelFormat;
|
typedef wxPixelFormat<unsigned char,32,0,1,2> PixelFormat;
|
||||||
wxPixelData<wxBitmap,PixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
wxPixelData<wxBitmap,PixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
||||||
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
||||||
false, "Unable to access raw data");
|
false, wxT("Unable to access raw data"));
|
||||||
}
|
}
|
||||||
// 32-bpp RGBA
|
// 32-bpp RGBA
|
||||||
else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==4 && [srcBitmapRep hasAlpha]==YES)
|
else if([srcBitmapRep bitsPerPixel]==32 && [srcBitmapRep bitsPerSample]==8 && [srcBitmapRep samplesPerPixel]==4 && [srcBitmapRep hasAlpha]==YES)
|
||||||
{
|
{
|
||||||
wxPixelData<wxBitmap,wxAlphaPixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
wxPixelData<wxBitmap,wxAlphaPixelFormat> pixelData(const_cast<wxBitmap&>(bitmap));
|
||||||
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
wxCHECK_MSG(wxMask_CreateFromBitmapData(pixelData, colour, dstData),
|
||||||
false, "Unable to access raw data");
|
false, wxT("Unable to access raw data"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ wxCHECK_MSG(false,false,"Unimplemented pixel format"); }
|
{ wxCHECK_MSG(false,false,wxT("Unimplemented pixel format")); }
|
||||||
|
|
||||||
// maskRep was autoreleased in case we had to exit quickly
|
// maskRep was autoreleased in case we had to exit quickly
|
||||||
m_cocoaNSBitmapImageRep = [maskRep retain];
|
m_cocoaNSBitmapImageRep = [maskRep retain];
|
||||||
|
@@ -32,10 +32,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxValidator& validator, const wxString& name)
|
const wxValidator& validator, const wxString& name)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxLogDebug("Creating control with id=%d",winid);
|
wxLogDebug(wxT("Creating control with id=%d"),winid);
|
||||||
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug("Created control with id=%d",GetId());
|
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -60,7 +60,7 @@ wxBitmapButton::~wxBitmapButton()
|
|||||||
|
|
||||||
void wxBitmapButton::Cocoa_wxNSButtonAction(void)
|
void wxBitmapButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("YAY!");
|
wxLogDebug(wxT("YAY!"));
|
||||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
||||||
InitCommandEvent(event); // event.SetEventObject(this);
|
InitCommandEvent(event); // event.SetEventObject(this);
|
||||||
Command(event);
|
Command(event);
|
||||||
|
@@ -32,10 +32,10 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxValidator& validator, const wxString& name)
|
const wxValidator& validator, const wxString& name)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxLogDebug("Creating control with id=%d",winid);
|
wxLogDebug(wxT("Creating control with id=%d"),winid);
|
||||||
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug("Created control with id=%d",GetId());
|
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -60,7 +60,7 @@ wxButton::~wxButton()
|
|||||||
|
|
||||||
void wxButton::Cocoa_wxNSButtonAction(void)
|
void wxButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("YAY!");
|
wxLogDebug(wxT("YAY!"));
|
||||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
|
||||||
InitCommandEvent(event); // event.SetEventObject(this);
|
InitCommandEvent(event); // event.SetEventObject(this);
|
||||||
Command(event);
|
Command(event);
|
||||||
|
@@ -74,7 +74,7 @@ bool wxCheckBox::GetValue() const
|
|||||||
|
|
||||||
void wxCheckBox::Cocoa_wxNSButtonAction(void)
|
void wxCheckBox::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("Checkbox");
|
wxLogDebug(wxT("Checkbox"));
|
||||||
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId());
|
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId());
|
||||||
InitCommandEvent(event); // event.SetEventObject(this);
|
InitCommandEvent(event); // event.SetEventObject(this);
|
||||||
event.SetInt(GetValue());
|
event.SetInt(GetValue());
|
||||||
|
@@ -107,7 +107,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio
|
|||||||
NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"];
|
NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"];
|
||||||
int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem];
|
int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem];
|
||||||
int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem];
|
int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem];
|
||||||
wxLogDebug("menuDidSendAction, index=%d, selectedItem=%d", index, selectedItem);
|
wxLogDebug(wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem);
|
||||||
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
|
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
|
||||||
event.SetInt(index);
|
event.SetInt(index);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
@@ -45,10 +45,10 @@ bool wxControl::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
const wxPoint& pos, const wxSize& size, long style,
|
const wxPoint& pos, const wxSize& size, long style,
|
||||||
const wxValidator& validator, const wxString& name)
|
const wxValidator& validator, const wxString& name)
|
||||||
{
|
{
|
||||||
wxLogDebug("Creating control with id=%d",winid);
|
wxLogDebug(wxT("Creating control with id=%d"),winid);
|
||||||
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||||
return false;
|
return false;
|
||||||
wxLogDebug("Created control with id=%d",GetId());
|
wxLogDebug(wxT("Created control with id=%d"),GetId());
|
||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]);
|
||||||
// NOTE: YES we want to release this (to match the alloc).
|
// NOTE: YES we want to release this (to match the alloc).
|
||||||
@@ -78,7 +78,7 @@ wxSize wxControl::DoGetBestSize() const
|
|||||||
NSRect cocoaRect = [m_cocoaNSView frame];
|
NSRect cocoaRect = [m_cocoaNSView frame];
|
||||||
wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height);
|
wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height);
|
||||||
[m_cocoaNSView setFrame: storedRect];
|
[m_cocoaNSView setFrame: storedRect];
|
||||||
wxLogDebug("wxControl=%p::DoGetBestSize()==(%d,%d)",this,size.x,size.y);
|
wxLogDebug(wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,7 +70,7 @@ inline void CocoaSetPenForNSBezierPath(wxPen &pen, NSBezierPath *bezpath)
|
|||||||
|
|
||||||
void wxDC::CocoaInitializeTextSystem()
|
void wxDC::CocoaInitializeTextSystem()
|
||||||
{
|
{
|
||||||
wxASSERT_MSG(!sm_cocoaNSTextStorage && !sm_cocoaNSLayoutManager && !sm_cocoaNSTextContainer,"Text system already initalized! BAD PROGRAMMER!");
|
wxASSERT_MSG(!sm_cocoaNSTextStorage && !sm_cocoaNSLayoutManager && !sm_cocoaNSTextContainer,wxT("Text system already initalized! BAD PROGRAMMER!"));
|
||||||
|
|
||||||
sm_cocoaNSTextStorage = [[NSTextStorage alloc] init];
|
sm_cocoaNSTextStorage = [[NSTextStorage alloc] init];
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ void wxDC::CocoaUnwindStackAndLoseFocus()
|
|||||||
wxASSERT(dc!=this);
|
wxASSERT(dc!=this);
|
||||||
if(!dc->CocoaUnlockFocus())
|
if(!dc->CocoaUnlockFocus())
|
||||||
{
|
{
|
||||||
wxFAIL_MSG("Unable to unlock focus on higher-level DC!");
|
wxFAIL_MSG(wxT("Unable to unlock focus on higher-level DC!"));
|
||||||
}
|
}
|
||||||
sm_cocoaDCStack.DeleteNode(node);
|
sm_cocoaDCStack.DeleteNode(node);
|
||||||
}
|
}
|
||||||
@@ -205,7 +205,7 @@ void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord
|
|||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
// FIXME: Cache this so it can be used for DoDrawText
|
// FIXME: Cache this so it can be used for DoDrawText
|
||||||
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, "Text system has not been initialized. BAD PROGRAMMER!");
|
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!"));
|
||||||
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
||||||
initWithString:[NSString stringWithCString:text.c_str()]];
|
initWithString:[NSString stringWithCString:text.c_str()]];
|
||||||
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
||||||
@@ -226,7 +226,7 @@ void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord
|
|||||||
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
if(!CocoaTakeFocus()) return;
|
if(!CocoaTakeFocus()) return;
|
||||||
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, "Text system has not been initialized. BAD PROGRAMMER!");
|
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!"));
|
||||||
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
||||||
initWithString:[NSString stringWithCString:text.c_str()]];
|
initWithString:[NSString stringWithCString:text.c_str()]];
|
||||||
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
||||||
@@ -252,7 +252,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
// there is no length or we don't start at zero
|
// there is no length or we don't start at zero
|
||||||
if(!glyphRange.length)
|
if(!glyphRange.length)
|
||||||
return;
|
return;
|
||||||
wxASSERT_MSG(glyphRange.location==0,"glyphRange must begin at zero");
|
wxASSERT_MSG(glyphRange.location==0,wxT("glyphRange must begin at zero"));
|
||||||
|
|
||||||
NSAffineTransform *transform = [NSAffineTransform transform];
|
NSAffineTransform *transform = [NSAffineTransform transform];
|
||||||
[transform translateXBy:x yBy:y];
|
[transform translateXBy:x yBy:y];
|
||||||
@@ -274,7 +274,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||||||
[flipTransform concat];
|
[flipTransform concat];
|
||||||
#if 0
|
#if 0
|
||||||
// Draw+fill a rectangle so we can see where the shit is supposed to be.
|
// Draw+fill a rectangle so we can see where the shit is supposed to be.
|
||||||
wxLogDebug("(%f,%f) (%fx%f)",usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height);
|
wxLogDebug(wxT("(%f,%f) (%fx%f)"),usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height);
|
||||||
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)];
|
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)];
|
||||||
[[NSColor blackColor] set];
|
[[NSColor blackColor] set];
|
||||||
[bezpath stroke];
|
[bezpath stroke];
|
||||||
@@ -454,7 +454,7 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Draw a rect so we can see where it's supposed to be
|
// Draw a rect so we can see where it's supposed to be
|
||||||
wxLogDebug("image at (%d,%d) size %dx%d",x,y,bmp.GetWidth(),bmp.GetHeight());
|
wxLogDebug(wxT("image at (%d,%d) size %dx%d"),x,y,bmp.GetWidth(),bmp.GetHeight());
|
||||||
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,bmp.GetWidth(),bmp.GetHeight())];
|
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,bmp.GetWidth(),bmp.GetHeight())];
|
||||||
[[NSColor blackColor] set];
|
[[NSColor blackColor] set];
|
||||||
[bezpath stroke];
|
[bezpath stroke];
|
||||||
|
@@ -38,7 +38,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
|||||||
: m_window(window)
|
: m_window(window)
|
||||||
, m_lockedNSView(NULL)
|
, m_lockedNSView(NULL)
|
||||||
{
|
{
|
||||||
wxLogDebug("non-client window DC's are not supported, oh well");
|
wxLogDebug(wxT("non-client window DC's are not supported, oh well"));
|
||||||
};
|
};
|
||||||
|
|
||||||
wxWindowDC::~wxWindowDC(void)
|
wxWindowDC::~wxWindowDC(void)
|
||||||
@@ -57,7 +57,7 @@ bool wxWindowDC::CocoaLockFocusOnNSView(WX_NSView nsview)
|
|||||||
m_lockedNSView = nsview;
|
m_lockedNSView = nsview;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
wxLogDebug("focus lock failed!");
|
wxLogDebug(wxT("focus lock failed!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,13 +71,13 @@ bool wxWindowDC::CocoaUnlockFocusOnNSView()
|
|||||||
|
|
||||||
bool wxWindowDC::CocoaLockFocus()
|
bool wxWindowDC::CocoaLockFocus()
|
||||||
{
|
{
|
||||||
wxLogDebug("Locking focus on wxWindowDC=%p, NSView=%p",this, m_window->GetNonClientNSView());
|
wxLogDebug(wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
|
||||||
return CocoaLockFocusOnNSView(m_window->GetNonClientNSView());
|
return CocoaLockFocusOnNSView(m_window->GetNonClientNSView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::CocoaUnlockFocus()
|
bool wxWindowDC::CocoaUnlockFocus()
|
||||||
{
|
{
|
||||||
wxLogDebug("Unlocking focus on wxWindowDC=%p, NSView=%p",this, m_window->GetNonClientNSView());
|
wxLogDebug(wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView());
|
||||||
return CocoaUnlockFocusOnNSView();
|
return CocoaUnlockFocusOnNSView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,13 +115,13 @@ wxClientDC::~wxClientDC(void)
|
|||||||
|
|
||||||
bool wxClientDC::CocoaLockFocus()
|
bool wxClientDC::CocoaLockFocus()
|
||||||
{
|
{
|
||||||
wxLogDebug("Locking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView());
|
wxLogDebug(wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
|
||||||
return CocoaLockFocusOnNSView(m_window->GetNSView());
|
return CocoaLockFocusOnNSView(m_window->GetNSView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxClientDC::CocoaUnlockFocus()
|
bool wxClientDC::CocoaUnlockFocus()
|
||||||
{
|
{
|
||||||
wxLogDebug("Unlocking focus on wxClientDC=%p, NSView=%p",this, m_window->GetNSView());
|
wxLogDebug(wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView());
|
||||||
return CocoaUnlockFocusOnNSView();
|
return CocoaUnlockFocusOnNSView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ wxPaintDC::wxPaintDC(void)
|
|||||||
wxPaintDC::wxPaintDC( wxWindow *window )
|
wxPaintDC::wxPaintDC( wxWindow *window )
|
||||||
{
|
{
|
||||||
m_window = window;
|
m_window = window;
|
||||||
wxASSERT_MSG([NSView focusView]==window->GetNSView(), "PaintDC's NSView does not have focus. Please use wxPaintDC only as the first DC created in a paint handler");
|
wxASSERT_MSG([NSView focusView]==window->GetNSView(), wxT("PaintDC's NSView does not have focus. Please use wxPaintDC only as the first DC created in a paint handler"));
|
||||||
sm_cocoaDCStack.Insert(this);
|
sm_cocoaDCStack.Insert(this);
|
||||||
m_lockedNSView = window->GetNSView();
|
m_lockedNSView = window->GetNSView();
|
||||||
m_cocoaFlipped = [window->GetNSView() isFlipped];
|
m_cocoaFlipped = [window->GetNSView() isFlipped];
|
||||||
@@ -152,7 +152,7 @@ wxPaintDC::~wxPaintDC(void)
|
|||||||
|
|
||||||
bool wxPaintDC::CocoaLockFocus()
|
bool wxPaintDC::CocoaLockFocus()
|
||||||
{
|
{
|
||||||
wxFAIL_MSG("wxPaintDC cannot be asked to lock focus!");
|
wxFAIL_MSG(wxT("wxPaintDC cannot be asked to lock focus!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
|
|||||||
[transform concat];
|
[transform concat];
|
||||||
[flipTransform concat];
|
[flipTransform concat];
|
||||||
|
|
||||||
wxLogDebug("[m_cocoaNSImage isFlipped]=%d", [m_cocoaNSImage isFlipped]);
|
wxLogDebug(wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]);
|
||||||
[m_cocoaNSImage drawAtPoint: NSMakePoint(0,0)
|
[m_cocoaNSImage drawAtPoint: NSMakePoint(0,0)
|
||||||
fromRect: NSMakeRect(xsrc,
|
fromRect: NSMakeRect(xsrc,
|
||||||
m_selectedBitmap.GetHeight()-height-ysrc,
|
m_selectedBitmap.GetHeight()-height-ysrc,
|
||||||
|
@@ -75,7 +75,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
// Because we do not release on close, the following release matches the
|
// Because we do not release on close, the following release matches the
|
||||||
// above alloc and thus the retain count will be 1.
|
// above alloc and thus the retain count will be 1.
|
||||||
[m_cocoaNSWindow release];
|
[m_cocoaNSWindow release];
|
||||||
wxLogDebug("wxDialog m_cocoaNSWindow retainCount=%d",[m_cocoaNSWindow retainCount]);
|
wxLogDebug(wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]);
|
||||||
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
|
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
|
||||||
[m_cocoaNSWindow setHidesOnDeactivate:NO];
|
[m_cocoaNSWindow setHidesOnDeactivate:NO];
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
|
|
||||||
wxDialog::~wxDialog()
|
wxDialog::~wxDialog()
|
||||||
{
|
{
|
||||||
wxLogDebug("Destroying");
|
wxLogDebug(wxT("Destroying"));
|
||||||
// setReleasedWhenClosed: NO
|
// setReleasedWhenClosed: NO
|
||||||
[m_cocoaNSWindow close];
|
[m_cocoaNSWindow close];
|
||||||
DisassociateNSPanel(GetNSPanel());
|
DisassociateNSPanel(GetNSPanel());
|
||||||
@@ -94,7 +94,7 @@ void wxDialog::CocoaDelegate_windowWillClose(void)
|
|||||||
{
|
{
|
||||||
m_closed = true;
|
m_closed = true;
|
||||||
/* Actually, this isn't true anymore */
|
/* Actually, this isn't true anymore */
|
||||||
wxLogDebug("Woah: Dialogs are not generally closed");
|
wxLogDebug(wxT("Woah: Dialogs are not generally closed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDialog::SetModal(bool flag)
|
void wxDialog::SetModal(bool flag)
|
||||||
@@ -124,7 +124,7 @@ bool wxDialog::Show(bool show)
|
|||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxModalDialogs.Append(this);
|
wxModalDialogs.Append(this);
|
||||||
wxLogDebug("runModal");
|
wxLogDebug(wxT("runModal"));
|
||||||
NSApplication *theNSApp = wxTheApp->GetNSApplication();
|
NSApplication *theNSApp = wxTheApp->GetNSApplication();
|
||||||
// If the app hasn't started, flush the event queue
|
// If the app hasn't started, flush the event queue
|
||||||
// If we don't do this, the Dock doesn't get the message that
|
// If we don't do this, the Dock doesn't get the message that
|
||||||
@@ -141,11 +141,11 @@ bool wxDialog::Show(bool show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
[wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow];
|
[wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow];
|
||||||
wxLogDebug("runModal END");
|
wxLogDebug(wxT("runModal END"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug("abortModal");
|
wxLogDebug(wxT("abortModal"));
|
||||||
[wxTheApp->GetNSApplication() abortModal];
|
[wxTheApp->GetNSApplication() abortModal];
|
||||||
wxModalDialogs.DeleteObject(this);
|
wxModalDialogs.DeleteObject(this);
|
||||||
}
|
}
|
||||||
@@ -198,13 +198,13 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
|||||||
|
|
||||||
if ( closing.Member(this) )
|
if ( closing.Member(this) )
|
||||||
{
|
{
|
||||||
wxLogDebug("WARNING: Attempting to recursively call Close for dialog");
|
wxLogDebug(wxT("WARNING: Attempting to recursively call Close for dialog"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
closing.Append(this);
|
closing.Append(this);
|
||||||
|
|
||||||
wxLogDebug("Sending Cancel Event");
|
wxLogDebug(wxT("Sending Cancel Event"));
|
||||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||||
cancelEvent.SetEventObject( this );
|
cancelEvent.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
|
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
|
||||||
@@ -230,7 +230,7 @@ void wxDialog::OnApply(wxCommandEvent& event)
|
|||||||
|
|
||||||
void wxDialog::OnCancel(wxCommandEvent& event)
|
void wxDialog::OnCancel(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxLogDebug("Cancelled!");
|
wxLogDebug(wxT("Cancelled!"));
|
||||||
EndModal(wxID_CANCEL);
|
EndModal(wxID_CANCEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ void wxEventLoop::Exit(int rc)
|
|||||||
m_impl->SetExitCode(rc);
|
m_impl->SetExitCode(rc);
|
||||||
|
|
||||||
NSApplication *cocoaApp = [NSApplication sharedApplication];
|
NSApplication *cocoaApp = [NSApplication sharedApplication];
|
||||||
wxLogDebug("wxEventLoop::Exit isRunning=%d", (int)[cocoaApp isRunning]);
|
wxLogDebug(wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]);
|
||||||
wxTheApp->WakeUpIdle();
|
wxTheApp->WakeUpIdle();
|
||||||
/* Notes:
|
/* Notes:
|
||||||
If we're being called from idle time (which occurs while checking the
|
If we're being called from idle time (which occurs while checking the
|
||||||
|
@@ -165,7 +165,7 @@ void wxFrame::UpdateFrameNSView()
|
|||||||
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
|
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
|
||||||
sbarheight = sbarRect.size.height;
|
sbarheight = sbarRect.size.height;
|
||||||
}
|
}
|
||||||
wxLogDebug("frame height=%f, tbar=%f, sbar=%f",frameRect.size.height,tbarheight,sbarheight);
|
wxLogDebug(wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight);
|
||||||
NSRect innerRect = [m_cocoaNSView frame];
|
NSRect innerRect = [m_cocoaNSView frame];
|
||||||
innerRect.size.height = frameRect.size.height - tbarheight - sbarheight;
|
innerRect.size.height = frameRect.size.height - tbarheight - sbarheight;
|
||||||
innerRect.origin.y = sbarheight;
|
innerRect.origin.y = sbarheight;
|
||||||
|
@@ -49,7 +49,7 @@
|
|||||||
@implementation wxMenuBarManagerObserver : NSObject
|
@implementation wxMenuBarManagerObserver : NSObject
|
||||||
- (id)init
|
- (id)init
|
||||||
{
|
{
|
||||||
wxFAIL_MSG("[wxMenuBarManagerObserver -init] should never be called!");
|
wxFAIL_MSG(wxT("[wxMenuBarManagerObserver -init] should never be called!"));
|
||||||
m_mbarman = NULL;
|
m_mbarman = NULL;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ void wxMenuBarManager::InstallMenuBarForWindow(wxCocoaNSWindow *win)
|
|||||||
wxASSERT(win);
|
wxASSERT(win);
|
||||||
m_windowCurrent = win;
|
m_windowCurrent = win;
|
||||||
wxMenuBar *menubar = win->GetAppMenuBar(win);
|
wxMenuBar *menubar = win->GetAppMenuBar(win);
|
||||||
wxLogDebug("Found menubar=%p for window=%p.",menubar,win);
|
wxLogDebug(wxT("Found menubar=%p for window=%p."),menubar,win);
|
||||||
SetMenuBar(menubar);
|
SetMenuBar(menubar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntM
|
|||||||
@implementation wxMDIParentFrameObserver : NSObject
|
@implementation wxMDIParentFrameObserver : NSObject
|
||||||
- (id)init
|
- (id)init
|
||||||
{
|
{
|
||||||
wxFAIL_MSG("[wxMDIParentFrameObserver -init] should never be called!");
|
wxFAIL_MSG(wxT("[wxMDIParentFrameObserver -init] should never be called!"));
|
||||||
m_mdiParent = NULL;
|
m_mdiParent = NULL;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ wxMenuBar *wxMDIParentFrame::GetAppMenuBar(wxCocoaNSWindow *win)
|
|||||||
|
|
||||||
void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
|
void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey",this);
|
wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
||||||
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild)
|
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild)
|
||||||
{
|
{
|
||||||
sm_cocoaDeactivateWindow = NULL;
|
sm_cocoaDeactivateWindow = NULL;
|
||||||
@@ -183,7 +183,7 @@ void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
|
|
||||||
void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void)
|
void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey",this);
|
wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
if(m_closed)
|
if(m_closed)
|
||||||
wxFrame::CocoaDelegate_windowDidResignKey();
|
wxFrame::CocoaDelegate_windowDidResignKey();
|
||||||
else
|
else
|
||||||
@@ -280,7 +280,7 @@ void wxMDIChildFrame::Activate()
|
|||||||
|
|
||||||
void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void)
|
void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey",this);
|
wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
||||||
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent)
|
if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent)
|
||||||
{
|
{
|
||||||
sm_cocoaDeactivateWindow = NULL;
|
sm_cocoaDeactivateWindow = NULL;
|
||||||
@@ -299,7 +299,7 @@ void wxMDIChildFrame::CocoaDelegate_windowDidBecomeMain(void)
|
|||||||
|
|
||||||
void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void)
|
void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey",this);
|
wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
sm_cocoaDeactivateWindow = this;
|
sm_cocoaDeactivateWindow = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -105,7 +105,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxLogDebug("append menu=%p, title=%s",menu,title.c_str());
|
wxLogDebug(wxT("append menu=%p, title=%s"),menu,title.c_str());
|
||||||
if(!wxMenuBarBase::Append(menu,title))
|
if(!wxMenuBarBase::Append(menu,title))
|
||||||
return false;
|
return false;
|
||||||
wxASSERT(menu);
|
wxASSERT(menu);
|
||||||
@@ -125,7 +125,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||||
{
|
{
|
||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
wxLogDebug("insert pos=%lu, menu=%p, title=%s",pos,menu,title.c_str());
|
wxLogDebug(wxT("insert pos=%lu, menu=%p, title=%s"),pos,menu,title.c_str());
|
||||||
// Get the current menu at this position
|
// Get the current menu at this position
|
||||||
wxMenu *nextmenu = GetMenu(pos);
|
wxMenu *nextmenu = GetMenu(pos);
|
||||||
if(!wxMenuBarBase::Insert(pos,menu,title))
|
if(!wxMenuBarBase::Insert(pos,menu,title))
|
||||||
|
@@ -54,17 +54,17 @@
|
|||||||
|
|
||||||
- (void)wxMenuItemAction: (id)sender
|
- (void)wxMenuItemAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug("wxMenuItemAction");
|
wxLogDebug(wxT("wxMenuItemAction"));
|
||||||
wxMenuItem *item = wxMenuItem::GetFromCocoa(sender);
|
wxMenuItem *item = wxMenuItem::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(item,"wxMenuItemAction received but no wxMenuItem exists!");
|
wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!"));
|
||||||
|
|
||||||
wxMenu *menu = item->GetMenu();
|
wxMenu *menu = item->GetMenu();
|
||||||
wxCHECK_RET(menu,"wxMenuItemAction received but wxMenuItem is not in a wxMenu");
|
wxCHECK_RET(menu,wxT("wxMenuItemAction received but wxMenuItem is not in a wxMenu"));
|
||||||
wxMenuBar *menubar = menu->GetMenuBar();
|
wxMenuBar *menubar = menu->GetMenuBar();
|
||||||
if(menubar)
|
if(menubar)
|
||||||
{
|
{
|
||||||
wxFrame *frame = menubar->GetFrame();
|
wxFrame *frame = menubar->GetFrame();
|
||||||
wxCHECK_RET(frame, "wxMenuBar MUST be attached to a wxFrame!");
|
wxCHECK_RET(frame, wxT("wxMenuBar MUST be attached to a wxFrame!"));
|
||||||
frame->ProcessCommand(item->GetId());
|
frame->ProcessCommand(item->GetId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,9 +72,9 @@
|
|||||||
- (BOOL)validateMenuItem: (id)menuItem
|
- (BOOL)validateMenuItem: (id)menuItem
|
||||||
{
|
{
|
||||||
// TODO: Do wxWindows validation here and avoid sending during idle time
|
// TODO: Do wxWindows validation here and avoid sending during idle time
|
||||||
wxLogDebug("wxMenuItemAction");
|
wxLogDebug(wxT("wxMenuItemAction"));
|
||||||
wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
|
wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
|
||||||
wxCHECK_MSG(item,NO,"validateMenuItem received but no wxMenuItem exists!");
|
wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!"));
|
||||||
return item->IsEnabled();
|
return item->IsEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ void wxMenuItem::Enable(bool bDoEnable)
|
|||||||
|
|
||||||
void wxMenuItem::Check(bool bDoCheck)
|
void wxMenuItem::Check(bool bDoCheck)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
|
wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
|
||||||
wxMenuItemBase::Check(bDoCheck);
|
wxMenuItemBase::Check(bDoCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
{
|
{
|
||||||
m_radioMaster = radioButton->m_radioMaster;
|
m_radioMaster = radioButton->m_radioMaster;
|
||||||
wxASSERT_MSG(m_radioMaster,
|
wxASSERT_MSG(m_radioMaster,
|
||||||
"Previous radio button should be part of a group");
|
wxT("Previous radio button should be part of a group"));
|
||||||
// Don't crash, assume user meant wxRB_SINGLE
|
// Don't crash, assume user meant wxRB_SINGLE
|
||||||
if(m_radioMaster)
|
if(m_radioMaster)
|
||||||
m_radioMaster->m_radioSlaves.Append(this);
|
m_radioMaster->m_radioSlaves.Append(this);
|
||||||
@@ -140,7 +140,7 @@ bool wxRadioButton::GetValue() const
|
|||||||
|
|
||||||
void wxRadioButton::Cocoa_wxNSButtonAction(void)
|
void wxRadioButton::Cocoa_wxNSButtonAction(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxRadioButton");
|
wxLogDebug(wxT("wxRadioButton"));
|
||||||
if(m_radioMaster && ([GetNSButton() state] == NSOnState))
|
if(m_radioMaster && ([GetNSButton() state] == NSOnState))
|
||||||
{
|
{
|
||||||
for(wxRadioButtonList::compatibility_iterator slaveNode =
|
for(wxRadioButtonList::compatibility_iterator slaveNode =
|
||||||
|
@@ -71,9 +71,9 @@ protected:
|
|||||||
|
|
||||||
- (void)wxNSActionCellAction: (id)sender
|
- (void)wxNSActionCellAction: (id)sender
|
||||||
{
|
{
|
||||||
wxLogDebug("wxNSActionCellAction");
|
wxLogDebug(wxT("wxNSActionCellAction"));
|
||||||
wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
|
wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
|
||||||
wxCHECK_RET(wxcontrol,"wxNSActionCellAction received but no wxCocoaNSActionCell exists!");
|
wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!"));
|
||||||
wxcontrol->CocoaTarget_wxNSActionCellAction();
|
wxcontrol->CocoaTarget_wxNSActionCellAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
|
|||||||
untilMouseUp:NO])
|
untilMouseUp:NO])
|
||||||
{
|
{
|
||||||
m_mouseDownTool = NULL;
|
m_mouseDownTool = NULL;
|
||||||
wxLogDebug("Button was clicked after drag!");
|
wxLogDebug(wxT("Button was clicked after drag!"));
|
||||||
}
|
}
|
||||||
[buttonCell setHighlighted: NO];
|
[buttonCell setHighlighted: NO];
|
||||||
}
|
}
|
||||||
@@ -320,7 +320,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
|
|||||||
untilMouseUp:NO])
|
untilMouseUp:NO])
|
||||||
{
|
{
|
||||||
m_mouseDownTool = NULL;
|
m_mouseDownTool = NULL;
|
||||||
wxLogDebug("Button was clicked!");
|
wxLogDebug(wxT("Button was clicked!"));
|
||||||
}
|
}
|
||||||
[buttonCell setHighlighted: NO];
|
[buttonCell setHighlighted: NO];
|
||||||
}
|
}
|
||||||
|
@@ -168,7 +168,7 @@ wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win)
|
|||||||
void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
||||||
{
|
{
|
||||||
bool need_debug = cocoaNSWindow || m_cocoaNSWindow;
|
bool need_debug = cocoaNSWindow || m_cocoaNSWindow;
|
||||||
if(need_debug) wxLogDebug("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d",this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]);
|
if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]);
|
||||||
DisassociateNSWindow(m_cocoaNSWindow);
|
DisassociateNSWindow(m_cocoaNSWindow);
|
||||||
[cocoaNSWindow retain];
|
[cocoaNSWindow retain];
|
||||||
[m_cocoaNSWindow release];
|
[m_cocoaNSWindow release];
|
||||||
@@ -178,7 +178,7 @@ void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow)
|
|||||||
else
|
else
|
||||||
SetNSView(NULL);
|
SetNSView(NULL);
|
||||||
AssociateNSWindow(m_cocoaNSWindow);
|
AssociateNSWindow(m_cocoaNSWindow);
|
||||||
if(need_debug) wxLogDebug("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d",this,cocoaNSWindow,[cocoaNSWindow retainCount]);
|
if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newView)
|
void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newView)
|
||||||
@@ -197,7 +197,7 @@ void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newVie
|
|||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
||||||
{
|
{
|
||||||
DeactivatePendingWindow();
|
DeactivatePendingWindow();
|
||||||
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this);
|
wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -205,7 +205,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey",this);
|
wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -213,12 +213,12 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
|||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain",this);
|
wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain",this);
|
wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void)
|
||||||
|
@@ -216,7 +216,7 @@ void wxWindowCocoaScroller::DoGetClientSize(int *x, int *y) const
|
|||||||
|
|
||||||
void wxWindowCocoaScroller::Cocoa_FrameChanged(void)
|
void wxWindowCocoaScroller::Cocoa_FrameChanged(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("Cocoa_FrameChanged");
|
wxLogDebug(wxT("Cocoa_FrameChanged"));
|
||||||
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
|
wxSizeEvent event(m_owner->GetSize(), m_owner->GetId());
|
||||||
event.SetEventObject(m_owner);
|
event.SetEventObject(m_owner);
|
||||||
m_owner->GetEventHandler()->ProcessEvent(event);
|
m_owner->GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -302,13 +302,13 @@ void wxWindowCocoa::CocoaRemoveFromParent(void)
|
|||||||
void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
|
void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView)
|
||||||
{
|
{
|
||||||
bool need_debug = cocoaNSView || m_cocoaNSView;
|
bool need_debug = cocoaNSView || m_cocoaNSView;
|
||||||
if(need_debug) wxLogDebug("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d",this,m_cocoaNSView,[m_cocoaNSView retainCount]);
|
if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]);
|
||||||
DisassociateNSView(m_cocoaNSView);
|
DisassociateNSView(m_cocoaNSView);
|
||||||
[cocoaNSView retain];
|
[cocoaNSView retain];
|
||||||
[m_cocoaNSView release];
|
[m_cocoaNSView release];
|
||||||
m_cocoaNSView = cocoaNSView;
|
m_cocoaNSView = cocoaNSView;
|
||||||
AssociateNSView(m_cocoaNSView);
|
AssociateNSView(m_cocoaNSView);
|
||||||
if(need_debug) wxLogDebug("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d",this,cocoaNSView,[cocoaNSView retainCount]);
|
if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
WX_NSView wxWindowCocoa::GetNSViewForSuperview() const
|
WX_NSView wxWindowCocoa::GetNSViewForSuperview() const
|
||||||
@@ -329,13 +329,13 @@ WX_NSView wxWindowCocoa::GetNSViewForHiding() const
|
|||||||
|
|
||||||
bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
||||||
{
|
{
|
||||||
wxLogDebug("Cocoa_drawRect");
|
wxLogDebug(wxT("Cocoa_drawRect"));
|
||||||
// Recursion can happen if the event loop runs from within the paint
|
// Recursion can happen if the event loop runs from within the paint
|
||||||
// handler. For instance, if an assertion dialog is shown.
|
// handler. For instance, if an assertion dialog is shown.
|
||||||
// FIXME: This seems less than ideal.
|
// FIXME: This seems less than ideal.
|
||||||
if(m_isInPaint)
|
if(m_isInPaint)
|
||||||
{
|
{
|
||||||
wxLogDebug("Paint event recursion!");
|
wxLogDebug(wxT("Paint event recursion!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//FIXME: should probably turn that rect into the update region
|
//FIXME: should probably turn that rect into the update region
|
||||||
@@ -349,7 +349,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
|||||||
|
|
||||||
void wxWindowCocoa::InitMouseEvent(wxMouseEvent& event, WX_NSEvent cocoaEvent)
|
void wxWindowCocoa::InitMouseEvent(wxMouseEvent& event, WX_NSEvent cocoaEvent)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG([m_cocoaNSView window]==[cocoaEvent window],"Mouse event for different NSWindow");
|
wxASSERT_MSG([m_cocoaNSView window]==[cocoaEvent window],wxT("Mouse event for different NSWindow"));
|
||||||
NSPoint cocoaPoint = [m_cocoaNSView convertPoint:[(NSEvent*)cocoaEvent locationInWindow] fromView:nil];
|
NSPoint cocoaPoint = [m_cocoaNSView convertPoint:[(NSEvent*)cocoaEvent locationInWindow] fromView:nil];
|
||||||
NSRect cocoaRect = [m_cocoaNSView frame];
|
NSRect cocoaRect = [m_cocoaNSView frame];
|
||||||
const wxPoint &clientorigin = GetClientAreaOrigin();
|
const wxPoint &clientorigin = GetClientAreaOrigin();
|
||||||
@@ -370,7 +370,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent)
|
|||||||
{
|
{
|
||||||
wxMouseEvent event(wxEVT_MOTION);
|
wxMouseEvent event(wxEVT_MOTION);
|
||||||
InitMouseEvent(event,theEvent);
|
InitMouseEvent(event,theEvent);
|
||||||
wxLogDebug("Mouse Drag @%d,%d",event.m_x,event.m_y);
|
wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ bool wxWindowCocoa::Cocoa_mouseDown(WX_NSEvent theEvent)
|
|||||||
{
|
{
|
||||||
wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK);
|
wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK);
|
||||||
InitMouseEvent(event,theEvent);
|
InitMouseEvent(event,theEvent);
|
||||||
wxLogDebug("Mouse Down @%d,%d num clicks=%d",event.m_x,event.m_y,[theEvent clickCount]);
|
wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]);
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent)
|
|||||||
wxMouseEvent event(wxEVT_MOTION);
|
wxMouseEvent event(wxEVT_MOTION);
|
||||||
InitMouseEvent(event,theEvent);
|
InitMouseEvent(event,theEvent);
|
||||||
event.m_leftDown = true;
|
event.m_leftDown = true;
|
||||||
wxLogDebug("Mouse Drag @%d,%d",event.m_x,event.m_y);
|
wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y);
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent)
|
|||||||
{
|
{
|
||||||
wxMouseEvent event(wxEVT_LEFT_UP);
|
wxMouseEvent event(wxEVT_LEFT_UP);
|
||||||
InitMouseEvent(event,theEvent);
|
InitMouseEvent(event,theEvent);
|
||||||
wxLogDebug("Mouse Up @%d,%d",event.m_x,event.m_y);
|
wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y);
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ bool wxWindowCocoa::Cocoa_otherMouseUp(WX_NSEvent theEvent)
|
|||||||
|
|
||||||
void wxWindowCocoa::Cocoa_FrameChanged(void)
|
void wxWindowCocoa::Cocoa_FrameChanged(void)
|
||||||
{
|
{
|
||||||
wxLogDebug("Cocoa_FrameChanged");
|
wxLogDebug(wxT("Cocoa_FrameChanged"));
|
||||||
wxSizeEvent event(GetSize(), m_windowId);
|
wxSizeEvent event(GetSize(), m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -493,7 +493,7 @@ bool wxWindow::Show(bool show)
|
|||||||
// If the window is marked as visible, then it shouldn't have a dummy view
|
// If the window is marked as visible, then it shouldn't have a dummy view
|
||||||
// If the window is marked hidden, then it should have a dummy view
|
// If the window is marked hidden, then it should have a dummy view
|
||||||
// wxSpinCtrl (generic) abuses m_isShown, don't use it for any logic
|
// wxSpinCtrl (generic) abuses m_isShown, don't use it for any logic
|
||||||
// wxASSERT_MSG( (m_isShown && !m_dummyNSView) || (!m_isShown && m_dummyNSView),"wxWindow: m_isShown does not agree with m_dummyNSView");
|
// wxASSERT_MSG( (m_isShown && !m_dummyNSView) || (!m_isShown && m_dummyNSView),wxT("wxWindow: m_isShown does not agree with m_dummyNSView"));
|
||||||
// Return false if there isn't a window to show or hide
|
// Return false if there isn't a window to show or hide
|
||||||
NSView *cocoaView = GetNSViewForHiding();
|
NSView *cocoaView = GetNSViewForHiding();
|
||||||
if(!cocoaView)
|
if(!cocoaView)
|
||||||
@@ -573,7 +573,7 @@ void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
|
|
||||||
NSView *nsview = GetNSViewForSuperview();
|
NSView *nsview = GetNSViewForSuperview();
|
||||||
NSView *superview = [nsview superview];
|
NSView *superview = [nsview superview];
|
||||||
wxCHECK_RET(superview,"NSView does not have a superview");
|
wxCHECK_RET(superview,wxT("NSView does not have a superview"));
|
||||||
NSRect parentRect = [superview bounds];
|
NSRect parentRect = [superview bounds];
|
||||||
|
|
||||||
NSRect cocoaRect = NSMakeRect(x,parentRect.size.height-(y+height),width,height);
|
NSRect cocoaRect = NSMakeRect(x,parentRect.size.height-(y+height),width,height);
|
||||||
@@ -586,7 +586,7 @@ void wxWindowCocoa::SetInitialFrameRect(const wxPoint& pos, const wxSize& size)
|
|||||||
{
|
{
|
||||||
NSView *nsview = GetNSViewForSuperview();
|
NSView *nsview = GetNSViewForSuperview();
|
||||||
NSView *superview = [nsview superview];
|
NSView *superview = [nsview superview];
|
||||||
wxCHECK_RET(superview,"NSView does not have a superview");
|
wxCHECK_RET(superview,wxT("NSView does not have a superview"));
|
||||||
NSRect parentRect = [superview bounds];
|
NSRect parentRect = [superview bounds];
|
||||||
NSRect frameRect = [nsview frame];
|
NSRect frameRect = [nsview frame];
|
||||||
if(size.x!=-1)
|
if(size.x!=-1)
|
||||||
@@ -621,7 +621,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const
|
|||||||
{
|
{
|
||||||
NSView *nsview = GetNSViewForSuperview();
|
NSView *nsview = GetNSViewForSuperview();
|
||||||
NSView *superview = [nsview superview];
|
NSView *superview = [nsview superview];
|
||||||
wxCHECK_RET(superview,"NSView does not have a superview");
|
wxCHECK_RET(superview,wxT("NSView does not have a superview"));
|
||||||
NSRect parentRect = [superview bounds];
|
NSRect parentRect = [superview bounds];
|
||||||
|
|
||||||
NSRect cocoaRect = [nsview frame];
|
NSRect cocoaRect = [nsview frame];
|
||||||
@@ -672,7 +672,7 @@ void wxWindow::DoClientToScreen(int *x, int *y) const
|
|||||||
// Get size *available for subwindows* i.e. excluding menu bar etc.
|
// Get size *available for subwindows* i.e. excluding menu bar etc.
|
||||||
void wxWindow::DoGetClientSize(int *x, int *y) const
|
void wxWindow::DoGetClientSize(int *x, int *y) const
|
||||||
{
|
{
|
||||||
wxLogDebug("DoGetClientSize:");
|
wxLogDebug(wxT("DoGetClientSize:"));
|
||||||
if(m_cocoaScroller)
|
if(m_cocoaScroller)
|
||||||
m_cocoaScroller->DoGetClientSize(x,y);
|
m_cocoaScroller->DoGetClientSize(x,y);
|
||||||
else
|
else
|
||||||
@@ -681,7 +681,7 @@ void wxWindow::DoGetClientSize(int *x, int *y) const
|
|||||||
|
|
||||||
void wxWindow::DoSetClientSize(int width, int height)
|
void wxWindow::DoSetClientSize(int width, int height)
|
||||||
{
|
{
|
||||||
wxLogDebug("DoSetClientSize=(%d,%d)",width,height);
|
wxLogDebug(wxT("DoSetClientSize=(%d,%d)"),width,height);
|
||||||
if(m_cocoaScroller)
|
if(m_cocoaScroller)
|
||||||
m_cocoaScroller->ClientSizeToSize(width,height);
|
m_cocoaScroller->ClientSizeToSize(width,height);
|
||||||
CocoaSetWxWindowSize(width,height);
|
CocoaSetWxWindowSize(width,height);
|
||||||
|
Reference in New Issue
Block a user