Unicode build fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25289 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9e888492a6
commit
b0c0a393c4
@ -47,14 +47,14 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = "notebook");
|
||||
const wxString& name = wxT("notebook"));
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = "notebook");
|
||||
const wxString& name = wxT("notebook"));
|
||||
// dtor
|
||||
~wxNotebook();
|
||||
|
||||
|
@ -191,11 +191,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
||||
if ( argc > 1 )
|
||||
{
|
||||
static const wxChar *ARG_PSN = _T("-psn_");
|
||||
if ( wxStrncmp(argv[1], ARG_PSN, strlen(ARG_PSN)) == 0 )
|
||||
if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 )
|
||||
{
|
||||
// remove this argument
|
||||
--argc;
|
||||
memmove(argv + 1, argv + 2, argc * sizeof(char *));
|
||||
memmove(argv + 1, argv + 2, argc * sizeof(wxChar *));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ void wxButton::Cocoa_wxNSButtonAction(void)
|
||||
|
||||
wxString wxButton::GetLabel() const
|
||||
{
|
||||
return wxString([[GetNSButton() title] lossyCString]);
|
||||
return wxStringWithNSString([GetNSButton() title]);
|
||||
}
|
||||
|
||||
void wxButton::SetLabel(const wxString& label)
|
||||
|
@ -145,7 +145,7 @@ int wxChoice::GetCount() const
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
{
|
||||
return wxString([[(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n] lossyCString]);
|
||||
return wxStringWithNSString([(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n]);
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& title)
|
||||
|
@ -16,6 +16,7 @@
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
#include "wx/cocoa/string.h"
|
||||
|
||||
#import <AppKit/NSBezierPath.h>
|
||||
#import <AppKit/NSTextStorage.h>
|
||||
@ -207,7 +208,7 @@ void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord
|
||||
// FIXME: Cache this so it can be used for DoDrawText
|
||||
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!"));
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
||||
initWithString:[NSString stringWithCString:text.c_str()]];
|
||||
initWithString:wxNSStringWithWxString(text.c_str())];
|
||||
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
||||
[attributedString release];
|
||||
|
||||
@ -228,7 +229,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
if(!CocoaTakeFocus()) return;
|
||||
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!"));
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc]
|
||||
initWithString:[NSString stringWithCString:text.c_str()]];
|
||||
initWithString:wxNSStringWithWxString(text.c_str())];
|
||||
[sm_cocoaNSTextStorage setAttributedString:attributedString];
|
||||
[attributedString release];
|
||||
|
||||
|
@ -189,7 +189,7 @@ void wxFont::SetUnderlined(bool underlined)
|
||||
/* New font system */
|
||||
wxString wxFont::GetFaceName() const
|
||||
{
|
||||
wxString str("");
|
||||
wxString str;
|
||||
if (M_FONTDATA)
|
||||
str = M_FONTDATA->m_faceName ;
|
||||
return str;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
#include "wx/cocoa/string.h"
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <AppKit/NSMenu.h>
|
||||
@ -43,7 +44,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
||||
bool wxMenu::Create(const wxString& title, long style)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
m_cocoaNSMenu = [[NSMenu alloc] initWithTitle: [NSString stringWithCString: title.c_str()]];
|
||||
m_cocoaNSMenu = [[NSMenu alloc] initWithTitle: wxNSStringWithWxString(title)];
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -110,7 +111,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
||||
return false;
|
||||
wxASSERT(menu);
|
||||
wxASSERT(menu->GetNSMenu());
|
||||
NSString *menuTitle = [[NSString alloc] initWithCString: wxStripMenuCodes(title).c_str()];
|
||||
NSString *menuTitle = wxInitNSStringWithWxString([NSString alloc], wxStripMenuCodes(title));
|
||||
NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:NULL keyEquivalent:@""];
|
||||
[menu->GetNSMenu() setTitle:menuTitle];
|
||||
[newItem setSubmenu:menu->GetNSMenu()];
|
||||
@ -132,7 +133,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
return false;
|
||||
wxASSERT(menu);
|
||||
wxASSERT(menu->GetNSMenu());
|
||||
NSString *menuTitle = [[NSString alloc] initWithCString: title.c_str()];
|
||||
NSString *menuTitle = wxInitNSStringWithWxString([NSString alloc], title);
|
||||
NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:NULL keyEquivalent:@""];
|
||||
[menu->GetNSMenu() setTitle:menuTitle];
|
||||
[newItem setSubmenu:menu->GetNSMenu()];
|
||||
@ -180,7 +181,7 @@ wxString wxMenuBar::GetLabelTop(size_t pos) const
|
||||
wxMenu *menu = GetMenu(pos);
|
||||
int itemindex = [m_cocoaNSMenu indexOfItemWithSubmenu:menu->GetNSMenu()];
|
||||
wxASSERT(itemindex>=0);
|
||||
return wxString([[[m_cocoaNSMenu itemAtIndex:itemindex] title] lossyCString]);
|
||||
return wxStringWithNSString([[m_cocoaNSMenu itemAtIndex:itemindex] title]);
|
||||
}
|
||||
|
||||
void wxMenuBar::Attach(wxFrame *frame)
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "wx/cocoa/ObjcPose.h"
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
#include "wx/cocoa/string.h"
|
||||
|
||||
#import <AppKit/NSMenuItem.h>
|
||||
#import <AppKit/NSMenu.h>
|
||||
@ -134,7 +135,7 @@ wxMenuItemCocoa::wxMenuItemCocoa(wxMenu *pParentMenu,
|
||||
: wxMenuItemBase(pParentMenu, itemid, strName, strHelp, kind, pSubMenu)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
NSString *menuTitle = [[NSString alloc] initWithCString: wxStripMenuCodes(strName).c_str()];
|
||||
NSString *menuTitle = wxInitNSStringWithWxString([NSString alloc],wxStripMenuCodes(strName));
|
||||
m_cocoaNSMenuItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:@selector(wxMenuItemAction:) keyEquivalent:@""];
|
||||
sm_cocoaHash.insert(wxMenuItemCocoaHash::value_type(m_cocoaNSMenuItem,this));
|
||||
[m_cocoaNSMenuItem setTarget:sm_cocoaTarget];
|
||||
|
@ -16,6 +16,7 @@
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
#include "wx/cocoa/string.h"
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <AppKit/NSTextField.h>
|
||||
@ -39,7 +40,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid,
|
||||
m_cocoaNSView = NULL;
|
||||
SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]);
|
||||
[m_cocoaNSView release];
|
||||
[GetNSTextField() setStringValue:[NSString stringWithCString:label.c_str()]];
|
||||
[GetNSTextField() setStringValue:wxNSStringWithWxString(label)];
|
||||
// [GetNSTextField() setBordered: NO];
|
||||
[GetNSTextField() setBezeled: NO];
|
||||
[GetNSTextField() setEditable: NO];
|
||||
|
@ -41,7 +41,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid,
|
||||
m_cocoaNSView = NULL;
|
||||
SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]);
|
||||
[m_cocoaNSView release];
|
||||
[GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
|
||||
[GetNSTextField() setStringValue:wxNSStringWithWxString(value)];
|
||||
|
||||
[GetNSControl() sizeToFit];
|
||||
NSRect currentFrame = [m_cocoaNSView frame];
|
||||
if(currentFrame.size.width < 70)
|
||||
@ -200,6 +201,6 @@ bool wxTextCtrl::CanUndo() const
|
||||
wxString wxTextCtrl::GetValue() const
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
return wxString([[GetNSTextField() stringValue] lossyCString]);
|
||||
return wxStringWithNSString([GetNSTextField() stringValue]);
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ bool wxNotebook::DoPhase(int /* nPhase */)
|
||||
|
||||
void wxNotebook::Command(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFAIL_MSG("wxNotebook::Command not implemented");
|
||||
wxFAIL_MSG(wxT("wxNotebook::Command not implemented"));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user