dc->SetBrush(*focusedBrush);
else if (m_game->IsSelected(x,y))
dc->SetBrush(*wxWHITE_BRUSH);
- else
+ else
dc->SetBrush(*yellowBrush);
dc->DrawRectangle( x*m_cellWidth*X_UNIT, y*m_cellHeight*Y_UNIT,
m_cellWidth*X_UNIT+1, m_cellHeight*Y_UNIT+1);
wxString msg;
msg.Printf(wxT("%d bombs, %u marked, %d remaining cells"),
- m_game->GetNumBombs(), m_game->GetNumMarkedCells(),
+ m_game->GetNumBombs(), m_game->GetNumMarkedCells(),
m_game->GetNumRemainingCells() );
#if wxUSE_LOG && wxUSE_STATUSBAR
void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); }
void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); }
wxSize GetBitmapMargins() { return DoGetBitmapMargins(); }
-
+
// set the image position relative to the text, i.e. wxLEFT means that the
// image is to the left of the text (this is the default)
void SetBitmapPosition(wxDirection dir);
virtual bool ItemsChanged( const wxDataViewItemArray &items );
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
virtual bool Cleared() = 0;
-
+
// some platforms, such as GTK+, may need a two step procedure for ::Reset()
virtual bool BeforeReset() { return true; }
virtual bool AfterReset() { return Cleared(); }
// helper methods provided by list models only
virtual unsigned GetRow( const wxDataViewItem &item ) const = 0;
- // returns the number of rows
+ // returns the number of rows
virtual unsigned int GetCount() const = 0;
// implement some base class pure virtual directly
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const;
int GetChildCount( const wxDataViewItem& parent ) const;
-
+
void SetItemText( const wxDataViewItem& item, const wxString &text );
wxString GetItemText( const wxDataViewItem& item ) const;
void SetItemIcon( const wxDataViewItem& item, const wxIcon &icon );
// get the full name of the directory (without '/' at the end)
wxString GetName() const;
-
+
// file enumeration routines
// -------------------------
// static utilities for directory management
// (alias to wxFileName's functions for dirs)
// -----------------------------------------
-
+
// test for existence of a directory with the given name
static bool Exists(const wxString& dir);
int flags = 0);
static bool Remove(const wxString &dir, int flags = 0);
-
+
private:
friend class wxDirData;
wxDataViewChoiceByIndexRenderer( const wxArrayString &choices,
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
int alignment = wxDVR_DEFAULT_ALIGNMENT );
-
+
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
-
+
virtual bool SetValue( const wxVariant &value );
virtual bool GetValue( wxVariant &value ) const;
};
private:
// common part of all ctors
void Init(int width, wxAlignment align, int flags);
-
+
void UpdateDisplay();
wxString m_title;
wxGLAPI();
~wxGLAPI();
- static void glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
+ static void glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
GLfloat top, GLfloat zNear, GLfloat zFar);
static void glBegin(GLenum mode);
static void glTexCoord2f(GLfloat s, GLfloat t);
wxDataViewChoiceByIndexRenderer( const wxArrayString &choices,
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
int alignment = wxDVR_DEFAULT_ALIGNMENT );
-
+
virtual bool SetValue( const wxVariant &value );
virtual bool GetValue( wxVariant &value ) const;
-
+
private:
virtual void GtkOnTextEdited(const gchar *itempath, const wxString& str);
};
m_label = label;
m_key = key;
}
-
+
~wxGtkCollatableString()
{
- if (m_key)
+ if (m_key)
g_free( m_key );
}
{
public:
wxGtkCollatedArrayString() { }
-
+
int Add( const wxString &new_label )
{
int index = 0;
-
- gchar *new_key_lower = g_utf8_casefold( new_label.utf8_str(), -1);
- gchar *new_key = g_utf8_collate_key( new_key_lower, -1);
+
+ gchar *new_key_lower = g_utf8_casefold( new_label.utf8_str(), -1);
+ gchar *new_key = g_utf8_collate_key( new_key_lower, -1);
g_free( new_key_lower );
-
+
wxSharedPtr<wxGtkCollatableString> new_ptr( new wxGtkCollatableString( new_label, new_key ) );
-
+
wxVector< wxSharedPtr<wxGtkCollatableString> >::iterator iter;
for (iter = m_list.begin(); iter != m_list.end(); ++iter)
{
wxSharedPtr<wxGtkCollatableString> ptr = *iter;
-
+
gchar *key = ptr->m_key;
if (strcmp(key,new_key) >= 0)
{
}
index ++;
}
-
+
m_list.push_back( new_ptr );
return index;
}
-
+
size_t GetCount()
{
return m_list.size();
}
-
+
wxString At( size_t index )
{
return m_list[index]->m_label;
}
-
+
void Clear()
{
m_list.clear();
}
-
+
void RemoveAt( size_t index )
{
m_list.erase( m_list.begin() + index );
}
-
+
private:
wxVector< wxSharedPtr<wxGtkCollatableString> > m_list;
};
void GTKDisableEvents();
void GTKEnableEvents();
bool GTKEventsDisabled() const;
-
+
double m_pos;
int m_scrollEventType;
bool m_needThumbRelease;
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
-
+
// label for use with GetLabelSetLabel
wxString m_gtkLabel;
-
+
// return true if the window is of a standard (i.e. not wxWidgets') class
bool IsOfStandardClass() const { return m_wxwindow == NULL; }
}
wxDECLARE_CLASS_INFO_ITERATORS();
-
+
private:
const wxChar *m_className;
int m_objectSize;
#define wxIMPLEMENT_CLASS(name, basename) \
wxIMPLEMENT_ABSTRACT_CLASS(name, basename)
-
+
#define wxIMPLEMENT_CLASS2(name, basename1, basename2) \
IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)
const wxString& name = wxButtonNameStr);
protected:
-
+
virtual wxSize DoGetBestSize() const;
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
void OnEnterWindow( wxMouseEvent& event);
void OnLeaveWindow( wxMouseEvent& event);
-
+
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
m_marginY = y;
InvalidateBestSize();
}
-
+
// the margins around the bitmap
int m_marginX;
int m_marginY;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
- wxBitmap m_bitmaps[State_Max];
-
+ wxBitmap m_bitmaps[State_Max];
+
DECLARE_DYNAMIC_CLASS(wxButton)
DECLARE_EVENT_TABLE()
};
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void DoRun();
-
+
virtual void DoStop();
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
virtual bool IsFullScreen() const;
virtual bool ShowFullScreen(bool show, long style);
-
+
virtual void ShowWithoutActivating();
virtual void RequestUserAttention(int flags);
virtual void TransferPaperInfoTo( wxPrintData &data );
virtual void TransferResolutionTo( wxPrintData &data );
-
+
virtual void UpdateFromPMState();
virtual void UpdateToPMState();
ofItem:(id)item;
-(id)
- outlineView:(NSOutlineView*)outlineView
+ outlineView:(NSOutlineView*)outlineView
objectValueForTableColumn:(NSTableColumn*)tableColumn
byItem:(id)item;
{
public:
wxGUIEventLoop();
-
+
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
-
+
virtual void DoRun();
virtual void DoStop();
-
+
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
};
virtual void controlAction(WXWidget slf, void* _cmd, void* sender);
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender);
-
+
// for wxTextCtrl-derived classes, put here since they don't all derive
// from the same pimpl class.
virtual void controlTextDidChange();
virtual void WindowToScreen( int *x, int *y );
virtual bool IsActive();
-
+
virtual void SetModified(bool modified);
virtual bool IsModified() const;
virtual void SetSelection( long from , long to );
virtual void WriteText(const wxString& str) ;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
-
+
virtual bool GetStyle(long position, wxTextAttr& style);
virtual void SetStyle(long start, long end, const wxTextAttr& style);
-
+
virtual bool CanFocus() const;
-
+
virtual bool HasOwnContextMenu() const { return true; }
-
+
virtual void CheckSpelling(bool check);
virtual wxSize GetBestSize() const;
public :
wxNSComboBoxControl( wxComboBox *wxPeer, WXWidget w );
virtual ~wxNSComboBoxControl();
-
+
virtual int GetSelectedItem() const;
virtual void SetSelectedItem(int item);
-
+
virtual int GetNumberOfItems() const;
-
+
virtual void InsertItem(int pos, const wxString& item);
virtual void RemoveItem(int pos);
-
+
virtual void Clear();
-
+
virtual wxString GetStringAtIndex(int pos) const;
-
+
virtual int FindString(const wxString& text) const;
private:
NSComboBox* m_comboBox;
virtual void SetString(unsigned int n, const wxString& s);
virtual unsigned int GetCount() const;
-
+
// these methods are provided by wxTextEntry for the native impl.
#if wxOSX_USE_CARBON
// Text field functions
virtual void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) = 0;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
-
+
virtual void SetToolTip(wxToolTip* WXUNUSED(tooltip)) { }
// is the clicked event sent AFTER the state already changed, so no additional
virtual bool ButtonClickDidStateChange() = 0;
virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
-
+
// Mechanism used to keep track of whether a change should send an event
// Do SendEvents(false) when starting actions that would trigger programmatic events
// and SendEvents(true) at the end of the block.
long extraStyle);
#if wxOSX_USE_COCOA
- static wxWidgetImplType* CreateComboBox( wxComboBox* wxpeer,
- wxWindowMac* parent,
- wxWindowID id,
+ static wxWidgetImplType* CreateComboBox( wxComboBox* wxpeer,
+ wxWindowMac* parent,
+ wxWindowID id,
wxMenu* menu,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
- long style,
+ long style,
long extraStyle);
#endif
// accessing content
virtual unsigned int ListGetCount() const = 0;
-
+
virtual int DoListHitTest( const wxPoint& inpoint ) const = 0;
};
virtual int GetLineLength(long lineNo) const ;
virtual wxString GetLineText(long lineNo) const ;
virtual void CheckSpelling(bool WXUNUSED(check)) { }
-
+
virtual wxSize GetBestSize() const { return wxDefaultSize; }
private:
wxComboWidgetImpl() {}
virtual ~wxComboWidgetImpl() {}
-
+
virtual int GetSelectedItem() const { return -1; };
virtual void SetSelectedItem(int WXUNUSED(item)) {};
-
+
virtual int GetNumberOfItems() const { return -1; };
-
+
virtual void InsertItem(int WXUNUSED(pos), const wxString& WXUNUSED(item)) {}
-
+
virtual void RemoveItem(int WXUNUSED(pos)) {}
-
+
virtual void Clear() {}
-
+
virtual wxString GetStringAtIndex(int WXUNUSED(pos)) const { return wxEmptyString; }
-
+
virtual int FindString(const wxString& WXUNUSED(text)) const { return -1; }
};
public :
wxButtonImpl(){}
virtual ~wxButtonImpl(){}
-
+
virtual void SetPressedBitmap( const wxBitmap& bitmap ) = 0;
} ;
virtual void SetExtraStyle( long WXUNUSED(exStyle) )
{
}
-
+
virtual void SetWindowStyleFlag( long WXUNUSED(style) )
{
}
-
+
virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
{
return false ;
virtual bool IsFullScreen() const= 0;
virtual void ShowWithoutActivating() { Show(true); }
-
+
virtual bool ShowFullScreen(bool show, long style)= 0;
virtual void RequestUserAttention(int flags) = 0;
virtual void WindowToScreen( int *x, int *y ) = 0;
virtual bool IsActive() = 0;
-
+
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
static wxNonOwnedWindowImpl*
FindFromWXWindow(WXWindow window);
-
+
static void RemoveAssociations( wxNonOwnedWindowImpl* impl);
-
+
static void Associate( WXWindow window, wxNonOwnedWindowImpl *impl );
-
+
// static creation methods, must be implemented by all toolkits
static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow native) ;
-
+
static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name ) ;
-
+
virtual void SetModified(bool WXUNUSED(modified)) { }
virtual bool IsModified() const { return false; }
// show the dialog modally and return the value passed to EndModal()
virtual int ShowModal();
-
+
virtual void ShowWindowModal();
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
-
+
static bool OSXHasModalDialogsOpen();
static void OSXBeginModalDialog();
static void OSXEndModalDialog();
// --------------
wxDialogModality GetModality() const;
-
+
#if wxOSX_USE_COCOA
virtual void ModalFinishedCallback(void* WXUNUSED(panel), int WXUNUSED(returnCode)) {}
#endif
protected:
- // show window modal dialog
+ // show window modal dialog
void DoShowWindowModal();
// end window modal dialog.
wxDialogModality m_modality;
-
+
wxModalEventLoop* m_eventLoop;
private:
const wxString& name = wxDirDialogNameStr);
virtual int ShowModal();
-
+
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int returnCode);
-#endif
+#endif
protected:
// enters a loop calling OnNextIteration(), Pending() and Dispatch() and
// terminating when Exit() is called
virtual int Run();
-
+
// sets the "should exit" flag and wakes up the loop so that it terminates
// soon
virtual void Exit(int rc = 0);
-
+
// return true if any events are available
virtual bool Pending() const;
-
+
// dispatch a single event, return false if we should exit from the loop
virtual bool Dispatch();
-
+
// same as Dispatch() but doesn't wait for longer than the specified (in
// ms) timeout, return true if an event was processed, false if we should
// exit the loop or -1 if timeout expired
// implement this to wake up the loop: usually done by posting a dummy event
// to it (can be called from non main thread)
virtual void WakeUp();
-
+
virtual bool YieldFor(long eventsToProcess);
#if wxUSE_EVENTLOOP_SOURCE
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
virtual int DoDispatchTimeout(unsigned long timeout);
-
+
virtual void DoRun();
virtual void DoStop();
-
+
// should we exit the loop?
bool m_shouldExit;
// the loop exit code
int m_exitcode;
-
+
// cfrunloop
CFRunLoopRef m_runLoop;
-
+
// runloop observer
CFRunLoopObserverRef m_runLoopObserver;
-
+
private:
// process all already pending events and dispatch a new one (blocking
// until it appears in the event queue if necessary)
public:
wxModalEventLoop(wxWindow *modalWindow);
wxModalEventLoop(WXWindow modalNativeWindow);
-
+
protected:
virtual void DoRun();
-
+
virtual void DoStop();
-
+
// (in case) the modal window for this event loop
wxNonOwnedWindow* m_modalWindow;
WXWindow m_modalNativeWindow;
virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
virtual int ShowModal();
-
+
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int resultCode);
#endif
virtual bool SupportsExtraControl() const;
-
+
protected:
// not supported for file dialog, RR
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
-
+
void SetupExtraControls(WXWindow nativeWindow);
};
public:
// ctors and such
wxFont() { }
-
+
wxFont( wxOSXSystemFont systemFont );
#if wxOSX_USE_COCOA
#endif
#ifndef __WXUNIVERSAL__
-#undef wxUSE_SCROLLBAR
+#undef wxUSE_SCROLLBAR
#define wxUSE_SCROLLBAR 0
#endif
// FIXME: Does iPhone have a concept of inactive windows?
virtual bool IsActive() { return true; }
-
+
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
virtual bool InitialShowEventSent() { return m_initialShowSent; }
virtual void SetSelection( long from , long to );
virtual void WriteText(const wxString& str) ;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
-
+
virtual bool GetStyle(long position, wxTextAttr& style);
virtual void SetStyle(long start, long end, const wxTextAttr& style);
-
+
virtual bool CanFocus() const;
-
+
virtual bool HasOwnContextMenu() const { return true; }
-
+
virtual void CheckSpelling(bool check);
virtual wxSize GetBestSize() const;
public :
wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w );
virtual ~wxNSComboBoxControl();
-
+
virtual int GetSelectedItem() const;
virtual void SetSelectedItem(int item);
-
+
virtual int GetNumberOfItems() const;
-
+
virtual void InsertItem(int pos, const wxString& item);
virtual void RemoveItem(int pos);
-
+
virtual void Clear();
-
+
virtual wxString GetStringAtIndex(int pos) const;
-
+
virtual int FindString(const wxString& text) const;
private:
NSComboBox* m_comboBox;
const wxPoint& pos = wxDefaultPosition);
virtual int ShowModal();
-
+
#if wxOSX_USE_COCOA
virtual void ShowWindowModal();
virtual void ModalFinishedCallback(void* panel, int resultCode);
const wxString& name = wxPanelNameStr);
bool Create(wxWindow *parent, WXWindow nativeWindow);
-
+
virtual ~wxNonOwnedWindow();
-
+
virtual void SubclassWin(WXWindow nativeWindow);
virtual void UnsubclassWin();
virtual void HandleResized( double timestampsec );
virtual void HandleMoved( double timestampsec );
virtual void HandleResizing( double timestampsec, wxRect* rect );
-
+
virtual bool Destroy();
-
+
protected:
// common part of all ctors
void Init();
virtual bool OSXShowWithEffect(bool show,
wxShowEffect effect,
unsigned timeout);
-
+
virtual void WillBeDestroyed();
wxNonOwnedWindowImpl* m_nowpeer ;
// wxWindowMac* m_macFocus ;
static wxNonOwnedWindow *s_macDeactivateWindow;
-
+
private :
wxRegion m_shape;
};
{ (void)Create(parent, flags); }
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
-
+
virtual bool Show(bool show);
protected:
extern "C" {
#endif
- CGImageRef grabViaOpenGL(CGDirectDisplayID display,
+ CGImageRef grabViaOpenGL(CGDirectDisplayID display,
CGRect srcRect);
#if defined __cplusplus
public :
wxSoundData();
virtual ~wxSoundData();
-
+
virtual bool Play(unsigned int flags) = 0;
// stops the sound and deletes the optional timer
virtual void Stop();
// mark this to be deleted
virtual void MarkForDeletion();
virtual bool IsMarkedForDeletion() const { return m_markedForDeletion; }
-
+
// does the true work of stopping and cleaning up
virtual void DoStop() = 0;
protected :
void CreateAndStartTimer();
-
+
unsigned int m_flags;
wxSoundTimer* m_pTimer;
bool m_markedForDeletion;
bool Create(int size, const wxByte* data);
bool IsOk() const { return m_data != NULL; }
-
+
// Stop playing any sound
static void Stop();
-
+
// Returns true if a sound is being played
static bool IsPlaying();
-
+
// Notification when a sound has stopped
static void SoundStopped(const wxSoundData* data);
-
+
protected:
bool DoPlay(unsigned flags) const;
void Init();
private:
// data of this object
class wxSoundData *m_data;
-
+
wxDECLARE_NO_COPY_CLASS(wxSound);
};
virtual void Copy();
virtual void Cut();
virtual void Paste();
-
+
// Implementation
// --------------
virtual void Command(wxCommandEvent& event);
{
public:
- wxTextEntry()
+ wxTextEntry()
: m_editable(true),
m_maxLength(0)
{ }
-
+
virtual ~wxTextEntry() {};
virtual bool IsEditable() const;
protected:
virtual wxString DoGetValue() const;
-
+
bool m_editable;
// need to make this public because of the current implementation via callbacks
const wxString& name = wxToolBarNameStr);
virtual void SetWindowStyleFlag(long style);
-
+
virtual bool Destroy();
// override/implement base class virtuals
void OnMouse(wxMouseEvent& event) ;
virtual void MacSuperChangedPosition() ;
#endif
-
+
#if wxOSX_USE_NATIVE_TOOLBAR
bool MacInstallNativeToolbar(bool usesNative);
void MacUninstallNativeToolbar();
void* m_macToolbar ;
#endif
#ifdef __WXOSX_IPHONE__
- WX_UIView m_macToolbar;
+ WX_UIView m_macToolbar;
#endif
};
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
-
+
bool Create(wxWindow *parent, WXWindow nativeWindow);
-
+
virtual bool Destroy();
virtual wxPoint GetClientAreaOrigin() const;
virtual void Iconize(bool iconize = true);
virtual bool IsIconized() const;
virtual void Restore();
-
+
virtual bool IsActive();
virtual void ShowWithoutActivating();
virtual bool OSXHandleClicked( double timestampsec );
virtual bool OSXHandleKeyEvent( wxKeyEvent& event );
-
+
bool IsNativeWindowWrapper() const { return m_isNativeWindowWrapper; }
protected:
// For controls like radio buttons which are genuinely composite
bool m_vScrollBarAlwaysShown;
wxWindow* m_growBox ;
wxString m_label ;
-
+
bool m_isNativeWindowWrapper;
// set to true if we do a sharp clip at the content area of this window
modifying the value of the editor control (usually by clearing
it). Currently, this can work with following properties:
wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty.
-
+
@param enable
Whether to enable or disable this behavior (it is disabled by
default).
wxPG_VFB_MARK_CELL = 0x04,
/**
- Display a text message explaining the situation.
+ Display a text message explaining the situation.
To customize the way the message is displayed, you need to
reimplement wxPropertyGrid::DoShowPropertyError() in a
/**
Centers the splitter.
-
+
@param enableAutoResizing
If @true, automatic column resizing is enabled (only applicapple
if window style wxPG_SPLITTER_AUTO_CENTER is used).
wxColour m_button_bar_active_background_top_colour;
wxColour m_button_bar_active_background_top_gradient_colour;
wxColour m_gallery_button_background_colour;
- wxColour m_gallery_button_background_gradient_colour;
+ wxColour m_gallery_button_background_gradient_colour;
wxColour m_gallery_button_hover_background_colour;
wxColour m_gallery_button_hover_background_gradient_colour;
wxColour m_gallery_button_active_background_colour;
const wxString& label,
const wxBitmap& bitmap,
const wxString& help_string = wxEmptyString);
-
+
virtual wxRibbonButtonBarButtonBase* AddButton(
int button_id,
const wxString& label,
wxRIBBON_PANEL_NO_AUTO_MINIMISE = 1 << 0,
wxRIBBON_PANEL_EXT_BUTTON = 1 << 3,
wxRIBBON_PANEL_MINIMISE_BUTTON = 1 << 4,
-
+
wxRIBBON_PANEL_DEFAULT_STYLE = 0,
};
public:
wxRichTextAnchoredObjectAttr() { Init(); }
wxRichTextAnchoredObjectAttr(const wxRichTextAnchoredObjectAttr& attr) { Copy(attr); }
-
+
void Init();
void operator= (const wxRichTextAnchoredObjectAttr& attr) { Copy(attr); }
void Copy(const wxRichTextAnchoredObjectAttr& attr);
-
+
/// Is this anchored? TODO: difference between anchored and floating?
bool IsAnchored() const { return m_floating != wxRICHTEXT_FLOAT_NONE; }
/// Is this floating?
bool IsFloating() const { return m_floating != wxRICHTEXT_FLOAT_NONE; }
void SetFloatingMode(int floating) { m_floating = floating; }
-
+
int GetAlignment() const { return m_align; }
void SetAlignment(int align) { m_align = align; }
/// Dump to output stream for debugging
virtual void Dump(wxTextOutputStream& stream);
-
+
/// Can we edit properties via a GUI?
virtual bool CanEditProperties() const { return false; }
/// Invalidate the buffer. With no argument, invalidates whole buffer.
void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL);
-
+
/// Gather information about floating objects. If untilObj is non-NULL,
/// will stop getting information if the current object is this, since we
/// will collect the rest later.
// Make an image block from the wxImage in the given
// format.
virtual bool MakeImageBlock(wxImage& image, wxBitmapType imageType, int quality = 80);
-
+
// Uses a const wxImage for efficiency, but can't set quality (only relevant for JPEG)
virtual bool MakeImageBlockDefaultQuality(const wxImage& image, wxBitmapType imageType);
/////////////////////////////////////////////////////////////////////////////
// Name: wx/richtext/richtextimagedlg.h
-// Purpose:
+// Purpose:
// Author: Mingquan Yang
-// Modified by:
+// Modified by:
// Created: Wed 02 Jun 2010 11:27:23 CST
-// RCS-ID:
+// RCS-ID:
// Copyright: (c) Mingquan Yang
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
class WXDLLIMPEXP_RICHTEXT wxRichTextImageDialog: public wxDialog
-{
+{
DECLARE_DYNAMIC_CLASS( wxRichTextImageDialog )
DECLARE_EVENT_TABLE()
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
- // calls only RemoveMarkup() on the original label
+ // calls only RemoveMarkup() on the original label
// if the wxST_MARKUP style is set
// (but unlike GetLabelText won't remove mnemonics)
virtual wxString GetLabelWithoutMarkup() const;
- // just calls RemoveMarkup() & Ellipsize() on the original label
+ // just calls RemoveMarkup() & Ellipsize() on the original label
// if the wxST_MARKUP & wxST_ELLIPSIZE_* styles are set
// (but unlike GetLabelText won't remove mnemonics)
virtual wxString GetEllipsizedLabelWithoutMarkup() const;
// maximize the window to cover entire screen
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0;
-
+
// shows the window, but doesn't activate it. If the base code is being run,
// it means the port doesn't implement this method yet and so alert the user.
- virtual void ShowWithoutActivating() {
+ virtual void ShowWithoutActivating() {
wxFAIL_MSG("ShowWithoutActivating not implemented on this platform.");
}
// a different API for SetSizeHints
virtual void SetMinSize(const wxSize& minSize);
virtual void SetMaxSize(const wxSize& maxSize);
-
+
virtual void OSXSetModified(bool modified) { m_modified = modified; }
virtual bool OSXIsModified() const { return m_modified; }
// a temporary override of m_winDefault, use the latter if NULL
wxWindowRef m_winTmpDefault;
-
+
bool m_modified;
wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase);
#define wxTypeId(OBJ) (OBJ).GetWxTypeId()
-// Because abstract classes cannot be instantiated, we use
+// Because abstract classes cannot be instantiated, we use
// this macro to define pure virtual type interface for them.
#define WX_DECLARE_ABSTRACT_TYPEINFO(CLS) \
public: \
class PipeIOHandler;
}
-class WXDLLIMPEXP_BASE wxConsoleEventLoop
+class WXDLLIMPEXP_BASE wxConsoleEventLoop
#ifdef __WXOSX__
: public wxCFEventLoop
#else
accessibleFrame->Release();
return;
}
-
+
long obtained = 0;
VARIANT *var = new VARIANT[childCount];
VariantInit(& (var[i]));
var[i].vt = VT_DISPATCH;
}
-
+
if (S_OK == AccessibleChildren(accessibleFrame, 0, childCount, var, &obtained))
{
for (i = 0; i < childCount; i++)
if (var[i].pdispVal->QueryInterface(IID_IAccessible, (LPVOID*) & childAccessible) == S_OK)
{
var[i].pdispVal->Release();
-
+
wxString name, role;
GetInfo(childAccessible, 0, name, role);
wxString str;
VariantInit(& var);
var.vt = VT_I4;
var.lVal = id;
-
+
BSTR bStrName = 0;
HRESULT hResult = accessible->get_accName(var, & bStrName);
-
+
if (hResult == S_OK)
{
name = wxConvertStringFromOle(bStrName);
{
name = wxT("NO NAME");
}
-
+
VARIANT varRole;
VariantInit(& varRole);
-
+
hResult = accessible->get_accRole(var, & varRole);
-
+
if (hResult == S_OK && varRole.vt == VT_I4)
{
wxChar buf[256];
GetRoleText(varRole.lVal, buf, 256);
-
+
role = buf;
}
else
{
role = wxT("NO ROLE");
- }
+ }
}
/*
return wxACC_FALSE;
}
break;
-
+
case wxNAVDIR_LASTCHILD:
{
if (fromId == 2)
return wxACC_FALSE;
}
break;
-
+
case wxNAVDIR_LEFT:
{
if (splitter->GetSplitMode() != wxSPLIT_HORIZONTAL)
// below line is not executed due to earlier return
break;
#endif
-
+
case wxNAVDIR_NEXT:
{
if (fromId == 1)
// below line is not executed due to earlier return
break;
#endif
-
+
case wxNAVDIR_PREVIOUS:
{
if (fromId == 3)
// below line is not executed due to earlier return
break;
#endif
-
+
case wxNAVDIR_RIGHT:
{
if (splitter->GetSplitMode() != wxSPLIT_HORIZONTAL)
}
}
// Can't go right spatially if split horizontally.
- return wxACC_FALSE;
+ return wxACC_FALSE;
}
#if 0
// below line is not executed due to earlier return
break;
#endif
-
+
case wxNAVDIR_UP:
{
if (splitter->GetSplitMode() != wxSPLIT_VERTICAL)
}
// Can't go up spatially if split vertically.
- return wxACC_FALSE;
+ return wxACC_FALSE;
#if 0
// below line is not executed due to earlier return
break;
#endif
}
}
-
+
}
// Let the framework handle the other cases.
return wxACC_NOT_IMPLEMENTED;
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
-
+
m_canvas = new MyCanvas(this);
#if wxUSE_STATUSBAR
wxPaintDC dc( this );
PrepareDC( dc );
dc.Clear();
-
+
dc.SetFont( m_font );
for ( int y = 0; y < m_yChars; y++ )
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-
+
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
-
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// kill the last '\n'
input[wxStrlen(input) - 1] = 0;
-
+
if (wxStrcmp(input, "quit") == 0)
break;
ID_ADD_MANY = 203,
ID_HIDE_ATTRIBUTES = 204,
ID_SHOW_ATTRIBUTES = 205,
-
+
// Fourth page.
ID_DELETE_TREE_ITEM = 400,
ID_DELETE_ALL_TREE_ITEMS = 401,
#endif // wxUSE_DRAG_AND_DROP
EVT_RIGHT_UP(MyFrame::OnRightClick)
-
+
EVT_DATAVIEW_COLUMN_HEADER_CLICK(ID_ATTR_CTRL, MyFrame::OnAttrHeaderClick)
-
+
END_EVENT_TABLE()
MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int h):
m_ctrl[1]->AppendIconTextColumn("icon",
MyListModel::Col_IconText,
wxDATAVIEW_CELL_EDITABLE);
-
- m_attributes =
+
+ m_attributes =
new wxDataViewColumn("attributes",
new wxDataViewTextRenderer,
MyListModel::Col_TextWithAttr,
wxDataViewItem selected = ctrl->GetSelection();
if (!selected.IsOk())
return;
-
+
ctrl->DeleteItem(selected);
}
void MyListModel::DeleteItem( const wxDataViewItem &item )
{
unsigned int row = GetRow( item );
-
+
if (row >= m_textColValues.GetCount())
return;
wxCENTER |
wxNO_DEFAULT | wxYES_NO | wxCANCEL |
wxICON_INFORMATION);
-
+
wxString extmsg;
if ( dialog.SetYesNoCancelLabels
(
"so the default \"Yes\"/\"No\"/\"Cancel\" buttons are used.";
}
dialog.SetExtendedMessage(extmsg);
-
+
switch ( dialog.ShowModal() )
{
case wxID_YES:
wxLogStatus(wxT("You pressed \"Yes\""));
break;
-
+
case wxID_NO:
wxLogStatus(wxT("You pressed \"No\""));
break;
-
+
case wxID_CANCEL:
wxLogStatus(wxT("You pressed \"Cancel\""));
break;
-
+
default:
wxLogError(wxT("Unexpected wxMessageDialog return code!"));
}
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(icons) == MsgDlgIcon_Max, IconMismatch );
-
+
m_icons = new wxRadioBox(this, wxID_ANY, "&Icon style",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(icons), icons,
public:
wxTextDocument() : wxDocument() { }
- virtual bool OnCreate(const wxString& path, long flags);
+ virtual bool OnCreate(const wxString& path, long flags);
virtual wxTextCtrl* GetTextCtrl() const = 0;
++i )
{
const DoodleLines& lines = i->GetLines();
- for ( DoodleLines::const_iterator j = lines.begin();
+ for ( DoodleLines::const_iterator j = lines.begin();
j != lines.end();
++j )
{
m_currentlyHighlighted = (DragShape*) NULL;
m_draggedShape = (DragShape*) NULL;
-
+
Refresh(true);
}
else if (event.Dragging() && m_dragMode != TEST_DRAG_NONE)
if (mustUnhighlightOld || mustHighlightNew)
m_dragImage->Hide();
-
+
// Now with the drag image switched off, we can change the window contents.
if (mustUnhighlightOld)
m_currentlyHighlighted = (DragShape*) NULL;
dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(),
& memDC, 0, 0, wxCOPY, true);
-
+
if (highlight)
{
dc.SetPen(*wxWHITE_PEN);
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-
+
#include "wx/wxprec.h"
-
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
void OnBold(wxCommandEvent& event);
void OnLight(wxCommandEvent& event);
-
+
void OnItalic(wxCommandEvent& event);
void OnSlant(wxCommandEvent& event);
-
+
void OnUnderline(wxCommandEvent& event);
void OnwxPointerFont(wxCommandEvent& event);
void OnSetNativeDesc(wxCommandEvent& event);
void OnSetNativeUserDesc(wxCommandEvent& event);
-
+
void OnSetFamily(wxCommandEvent& event);
void OnSetFaceName(wxCommandEvent& event);
void OnSetEncoding(wxCommandEvent& event);
// menu items
Font_Quit = wxID_EXIT,
Font_About = wxID_ABOUT,
-
+
Font_ViewMsg = wxID_HIGHEST+1,
Font_TestTextValue,
Font_IncSize,
Font_DecSize,
-
+
Font_Bold,
Font_Light,
-
+
Font_Italic,
Font_Slant,
-
+
Font_Underlined,
-
+
// standard global wxFont objects:
Font_wxNORMAL_FONT,
Font_wxSMALL_FONT,
EVT_MENU(Font_IncSize, MyFrame::OnIncFont)
EVT_MENU(Font_DecSize, MyFrame::OnDecFont)
-
+
EVT_MENU(Font_Bold, MyFrame::OnBold)
EVT_MENU(Font_Light, MyFrame::OnLight)
-
+
EVT_MENU(Font_Italic, MyFrame::OnItalic)
EVT_MENU(Font_Slant, MyFrame::OnSlant)
-
+
EVT_MENU(Font_Underlined, MyFrame::OnUnderline)
EVT_MENU(Font_wxNORMAL_FONT, MyFrame::OnwxPointerFont)
wxT("Set &user font description\tShift-Ctrl-U"));
menuFont->AppendSeparator();
menuFont->Append(Font_SetFamily, wxT("Set font family"));
- menuFont->Append(Font_SetFaceName, wxT("Set font face name"));
+ menuFont->Append(Font_SetFaceName, wxT("Set font face name"));
menuFont->Append(Font_SetEncoding, wxT("Set font &encoding\tShift-Ctrl-E"));
wxMenu *menuSelect = new wxMenu;
menuSelect->Append(Font_Standard, wxT("Standar&d fonts"), menuStdFonts);
wxMenu *menuSettingFonts = new wxMenu;
- menuSettingFonts->Append(Font_wxSYS_OEM_FIXED_FONT, wxT("wxSYS_OEM_FIXED_FONT"),
+ menuSettingFonts->Append(Font_wxSYS_OEM_FIXED_FONT, wxT("wxSYS_OEM_FIXED_FONT"),
wxT("Original equipment manufacturer dependent fixed-pitch font."));
- menuSettingFonts->Append(Font_wxSYS_ANSI_FIXED_FONT, wxT("wxSYS_ANSI_FIXED_FONT"),
+ menuSettingFonts->Append(Font_wxSYS_ANSI_FIXED_FONT, wxT("wxSYS_ANSI_FIXED_FONT"),
wxT("Windows fixed-pitch (monospaced) font. "));
- menuSettingFonts->Append(Font_wxSYS_ANSI_VAR_FONT, wxT("wxSYS_ANSI_VAR_FONT"),
+ menuSettingFonts->Append(Font_wxSYS_ANSI_VAR_FONT, wxT("wxSYS_ANSI_VAR_FONT"),
wxT("Windows variable-pitch (proportional) font."));
- menuSettingFonts->Append(Font_wxSYS_SYSTEM_FONT, wxT("wxSYS_SYSTEM_FONT"),
+ menuSettingFonts->Append(Font_wxSYS_SYSTEM_FONT, wxT("wxSYS_SYSTEM_FONT"),
wxT("System font."));
menuSettingFonts->Append(Font_wxSYS_DEVICE_DEFAULT_FONT, wxT("wxSYS_DEVICE_DEFAULT_FONT"),
wxT("Device-dependent font."));
- menuSettingFonts->Append(Font_wxSYS_DEFAULT_GUI_FONT, wxT("wxSYS_DEFAULT_GUI_FONT"),
+ menuSettingFonts->Append(Font_wxSYS_DEFAULT_GUI_FONT, wxT("wxSYS_DEFAULT_GUI_FONT"),
wxT("Default font for user interface objects such as menus and dialog boxes. "));
menuSelect->Append(Font_SystemSettings, wxT("System fonts"), menuSettingFonts);
-
-
+
+
menuSelect->AppendSeparator();
menuSelect->Append(Font_EnumFamilies, wxT("Enumerate font &families\tCtrl-F"));
menuSelect->Append(Font_EnumFixedFamilies,
{
mbar->Check(Font_Light, font.GetWeight() == wxFONTWEIGHT_LIGHT);
mbar->Check(Font_Bold, font.GetWeight() == wxFONTWEIGHT_BOLD);
-
+
mbar->Check(Font_Italic, font.GetStyle() == wxFONTSTYLE_ITALIC);
#ifndef __WXMSW__
mbar->Check(Font_Slant, font.GetStyle() == wxFONTSTYLE_SLANT);
#endif
-
+
mbar->Check(Font_Underlined, font.GetUnderlined());
}
}
// output the font name/info
wxString fontInfo;
-
+
fontInfo.Printf(wxT("Face name: %s, family: %s"),
m_font.GetFaceName().c_str(),
m_font.GetFamilyString().c_str());
m_embeddedHelpWindow = new wxHtmlHelpWindow;
// m_embeddedHtmlHelp.UseConfig(config, rootPath); // Can set your own config object here
m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
-
+
m_embeddedHelpWindow->Create(this,
wxID_ANY, wxDefaultPosition, GetClientSize(), wxTAB_TRAVERSAL|wxNO_BORDER, wxHF_DEFAULT_STYLE);
-
+
m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));
m_embeddedHtmlHelp.Display(wxT("Introduction"));
#else
* the original, so abandoned.
Example:
-
+
wxConstrain(frame->panel,
-
+
( leftOf (frame->panel) = leftOf (frame),
topOf (frame->panel) = topOf (frame),
rightOf (frame->panel) = rightOf (frame),
wxConstraintOp operator = (const wxConstraintOp& arg2);
wxConstraintOp operator = (const int value);
-
+
friend wxConstraintOp operator % (const int perCent, const wxConstraintOp& arg2);
friend wxConstraintOp operator + (wxConstraintOp& arg1, int margin);
friend wxConstraintOp operator - (wxConstraintOp& arg1, int margin);
{
public:
MySimpleSizerFrame(const wxString &title, int x, int y );
-
+
void OnSetSmallSize( wxCommandEvent &event);
void OnSetBigSize( wxCommandEvent &event);
-
+
private:
wxTextCtrl *m_target;
{
public:
MyNestedSizerFrame(const wxString &title, int x, int y );
-
-
+
+
private:
wxTextCtrl *m_target;
};
#ifdef __WXMSW__
// this is useful to know specially when debugging :)
- wxLogMessage("Your version of comctl32.dll is: %d",
+ wxLogMessage("Your version of comctl32.dll is: %d",
wxApp::GetComCtl32Version());
#endif
// nmake -f makefile.vc BUILD=debug SHARED=0 DEBUG_RUNTIME_LIBS=0 RUNTIME_LIBS=static all
//
// Unless the run-time library settings match for wxWidgets and MFC, you
-// will get link errors for symbols such as __mbctype, __argc, and __argv
+// will get link errors for symbols such as __mbctype, __argc, and __argv
//
// (3) If you see bogus memory leaks within the MSVC IDE on exit, in this
// sample or in your own project, you must be using __WXDEBUG__ +
#define IDM_TEST 101
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-
+
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
-
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#define IDC_STATIC -1
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
panel->SetHelpText( wxT( "Panel with some Radio Buttons" ) );
#endif
- wxString animals[] =
+ wxString animals[] =
{ wxT("Fox"), wxT("Hare"), wxT("Rabbit"),
wxT("Sabre-toothed tiger"), wxT("T Rex") };
wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, wxT("Choose one"),
wxDefaultPosition, wxDefaultSize, 5, animals, 2, wxRA_SPECIFY_ROWS);
- wxString computers[] =
+ wxString computers[] =
{ wxT("Amiga"), wxT("Commodore 64"), wxT("PET"),
wxT("Another") };
#endif
(void) new wxStaticText( panel, wxID_ANY,
- wxT("This page intentionally left blank"),
+ wxT("This page intentionally left blank"),
wxPoint(10, 10) );
return panel;
panel->SetBackgroundColour( wxColour( wxT("MAROON") ) );
(void) new wxStaticText( panel, wxID_ANY,
- wxT("This page has been inserted, not added."),
+ wxT("This page has been inserted, not added."),
wxPoint(10, 10) );
return panel;
m_sizerFrame->Layout();
}
-void MyFrame::AddFlagStrIfFlagPresent(wxString & flagStr, long flags, long flag,
+void MyFrame::AddFlagStrIfFlagPresent(wxString & flagStr, long flags, long flag,
const wxChar * flagName) const
{
if( (flags & flag) == flag )
const wxImage img(DrawDice(256, i + 1));
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.GetWidth(), img.GetHeight(),
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.GetWidth(), img.GetHeight(),
0, GL_RGB, GL_UNSIGNED_BYTE, img.GetData());
}
wxLogMessage(wxT("Loaded %d vertices, %d triangles from '%s'"),
m_numverts, m_numverts-2, filename.c_str());
-
+
// NOTE: for some reason under wxGTK the following is required to avoid that
// the surface gets rendered in a small rectangle in the top-left corner of the frame
PostSizeEventToParent();
mdc.DrawLine(0, 0, 60, 15);
mdc.SelectObject(wxNullBitmap);
pg->SetPropertyImage( wxT("StringPropertyWithBitmap"), myTestBitmap );
-
+
// this value array would be optional if values matched string indexes
//long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX, wxMAXIMIZE_BOX };
InitPanel();
const int trySplitterPos = 50;
-
+
int style = wxPG_AUTO_SORT; // wxPG_SPLITTER_AUTO_CENTER;
pgman = m_pPropGridManager =
new wxPropertyGridManager(m_panel, wxID_ANY,
shapes->AddButton(ID_SQUARE, wxT("Square"), wxBitmap(square_xpm), wxEmptyString);
shapes->AddDropdownButton(ID_POLYGON, wxT("Other Polygon"), wxBitmap(hexagon_xpm), wxEmptyString);
- wxRibbonPanel *sizer_panel = new wxRibbonPanel(home, wxID_ANY, wxT("Panel with Sizer"),
- wxNullBitmap, wxDefaultPosition, wxDefaultSize,
+ wxRibbonPanel *sizer_panel = new wxRibbonPanel(home, wxID_ANY, wxT("Panel with Sizer"),
+ wxNullBitmap, wxDefaultPosition, wxDefaultSize,
wxRIBBON_PANEL_EXT_BUTTON);
wxArrayString as;
as.Add("Item 1");
as.Add("Item 2");
- wxComboBox* sizer_panelcombo = new wxComboBox(sizer_panel, wxID_ANY, wxEmptyString,
+ wxComboBox* sizer_panelcombo = new wxComboBox(sizer_panel, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, as, wxCB_READONLY);
- wxComboBox* sizer_panelcombo2 = new wxComboBox(sizer_panel, wxID_ANY, wxEmptyString,
+ wxComboBox* sizer_panelcombo2 = new wxComboBox(sizer_panel, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, as, wxCB_READONLY);
-
+
sizer_panelcombo->SetMinSize(wxSize(150, -1));
sizer_panelcombo2->SetMinSize(wxSize(150, -1));
else
gallery = new wxRibbonGallery(panel, gallery_id);
wxMemoryDC& dc = m_bitmap_creation_dc;
- wxRibbonGalleryItem *def_item =
+ wxRibbonGalleryItem *def_item =
AddColourToGallery(gallery, wxT("Default"), dc, &def);
gallery->SetSelection(def_item);
AddColourToGallery(gallery, wxT("BLUE"), dc);
return 0;
}
-// Create buffer to be sent by client. Buffer contains test indicator
+// Create buffer to be sent by client. Buffer contains test indicator
// message size and place for data
-// msgsize parameter contains size of data in bytes and
+// msgsize parameter contains size of data in bytes and
// if input value does not fit into 250 bytes then
// on exit is updated to new value that is multiply of 1024 bytes
char*
char* buf;
//if message should have more than 256 bytes then set it as
//test3 for compatibility with GUI server sample
- if ((*msgsize) > 250)
+ if ((*msgsize) > 250)
{
//send at least one kb of data
int size = (*msgsize)/1024 + 1;
Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
- long style =
+ long style =
#ifndef __WXMAC__
wxSUNKEN_BORDER|
#endif
void OnNewWindow(wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
void FileSavePicture (wxCommandEvent& event);
-
+
unsigned int GetCountOfChildren() const
{ return m_nWinCreated; }
private:
unsigned int m_nWinCreated;
-
+
DECLARE_EVENT_TABLE()
};
class MyChild: public wxMDIChildFrame
{
public:
- MyChild(wxMDIParentFrame *parent, const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
+ MyChild(wxMDIParentFrame *parent, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE);
~MyChild();
void OnActivate(wxActivateEvent& event);
void OnQuit(wxCommandEvent& event);
bool OnSave(wxString filename);
-
+
MyFrame* GetFrame()
{ return m_frame; }
private:
int m_index;
MyChild* m_child;
-
+
DECLARE_EVENT_TABLE()
};
{
(void)wxMessageBox(wxT("wxWidgets SVG sample\n")
wxT("Author: Chris Elliott (c) 2002-2009\n")
- wxT("Usage: click File|New to show tests"),
+ wxT("Usage: click File|New to show tests"),
wxT("About SVG Test"));
}
wxString title;
title.Printf(wxT("SVG Test Window %d"), m_nWinCreated );
-
+
// counts number of children previously, even if now closed
m_nWinCreated ++;
: wxMDIChildFrame(parent, wxID_ANY, title, pos, size, style)
{
m_frame = (MyFrame *) parent;
-
+
#if wxUSE_STATUSBAR
CreateStatusBar();
SetStatusText(title);
#endif // wxUSE_STATUSBAR
m_canvas = new MyCanvas(this, wxPoint(0, 0), GetClientSize());
-
+
// Give it scrollbars
m_canvas->SetScrollbars(20, 20, 50, 50);
}
m_extraToolBar = new wxToolBar(m_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_TEXT|wxTB_FLAT|wxTB_TOP);
PopulateToolbar(m_extraToolBar);
#endif
-
+
m_textWindow = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
{
m_treeCtrl->SetSpacing( indent-5 );
m_treeCtrl->Refresh();
- }
+ }
}
void MyFrame::OnToggleIcon(wxCommandEvent& WXUNUSED(event))
wxIcon icons[2];
icons[0] = wxIcon(unchecked_xpm);
icons[1] = wxIcon(checked_xpm);
-
+
int width = icons[0].GetWidth(),
height = icons[0].GetHeight();
-
+
// Make an state image list containing small icons
states = new wxImageList(width, height, true);
wxDefaultPosition, wxDefaultSize,
flags);
m_gauge->SetValue(val);
-
+
if ( flags & wxGA_VERTICAL )
m_sizerGauge->Add(m_gauge, 0, wxGROW | wxALL, 5);
else
// Author: Robin Dunn
// Created: 9-Dec-2006
// Id: $Id$
-// Copyright: (c) 2006
+// Copyright: (c) 2006
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void OnSearch(wxCommandEvent& event);
wxMenu* CreateTestMenu();
-
+
// (re)create the control
void CreateControl();
// reset the control parameters
void Reset();
-
-
+
+
wxSearchCtrl* m_srchCtrl;
wxCheckBox* m_searchBtnCheck;
wxCheckBox* m_cancelBtnCheck;
m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, wxT("Search menu"));
m_searchBtnCheck->SetValue(true);
-
+
box->Add(m_searchBtnCheck, 0, wxALL, 5);
box->Add(m_cancelBtnCheck, 0, wxALL, 5);
box->Add(m_menuBtnCheck, 0, wxALL, 5);
m_srchCtrl->Destroy();
int style = 0;
-
+
m_srchCtrl = new wxSearchCtrl(this, -1, wxEmptyString, wxDefaultPosition,
wxSize(150, -1), style);
}
void SearchCtrlWidgetsPage::Reset()
-{
+{
}
wxString tipText = wxString::Format(wxT("tip %i"),i);
menu->Append(ID_SEARCHMENU+i, itemText, tipText, wxITEM_NORMAL);
}
-// target->Connect(
+// target->Connect(
// ID_SEARCHMENU,
// ID_SEARCHMENU+SEARCH_MENU_SIZE,
// wxEVT_COMMAND_MENU_SELECTED,
void SearchCtrlWidgetsPage::OnToggleCancelButton(wxCommandEvent&)
{
m_srchCtrl->ShowCancelButton( m_cancelBtnCheck->GetValue() );
-
+
}
void SearchCtrlWidgetsPage::OnToggleSearchMenu(wxCommandEvent&)
}
// static
-void wxColourBase::MakeMono(unsigned char* r, unsigned char* g, unsigned char* b,
+void wxColourBase::MakeMono(unsigned char* r, unsigned char* g, unsigned char* b,
bool on)
{
*r = *g = *b = on ? 255 : 0;
}
// static
-void wxColourBase::MakeDisabled(unsigned char* r, unsigned char* g, unsigned char* b,
+void wxColourBase::MakeDisabled(unsigned char* r, unsigned char* g, unsigned char* b,
unsigned char brightness)
{
//MakeGrey(r, g, b, brightness); // grey no-blend version
// AlphaBlend is used by ChangeLightness and MakeDisabled
// static
-unsigned char wxColourBase::AlphaBlend(unsigned char fg, unsigned char bg,
+unsigned char wxColourBase::AlphaBlend(unsigned char fg, unsigned char bg,
double alpha)
{
double result = bg + (alpha * (fg - bg));
#else
return ( popupWinType == POPUPWIN_GENERICTLW
#if POPUPWIN_IS_PERFECT
- || popupWinType == POPUPWIN_WXPOPUPWINDOW
+ || popupWinType == POPUPWIN_WXPOPUPWINDOW
#endif
#if TRANSIENT_POPUPWIN_IS_PERFECT
- || popupWinType == POPUPWIN_WXPOPUPTRANSIENTWINDOW
+ || popupWinType == POPUPWIN_WXPOPUPTRANSIENTWINDOW
#endif
);
#endif
// There is special custom paint area - it is better to
// use some margin with the wxTextCtrl.
m_text->SetMargins(m_marginLeft);
- x = m_tcArea.x + m_widthCustomPaint +
+ x = m_tcArea.x + m_widthCustomPaint +
m_marginLeft + textCtrlXAdjust;
}
// NOTE: the following piece of code works also when len == 1
// start the removal process from the middle of the string
- // i.e. separe the string in three parts:
+ // i.e. separe the string in three parts:
// - the first one to preserve, valid range [0;initialCharToRemove-1] or the empty range if initialCharToRemove==0
// - the second one to remove, valid range [initialCharToRemove;endCharToRemove]
// - the third one to preserve, valid range [endCharToRemove+1;len-1] or the empty range if endCharToRemove==len-1
if (initialCharToRemove >= 2)
widthPx = charOffsetsPx[initialCharToRemove-1] - charOffsetsPx[initialCharToRemove-2];
else
- widthPx = charOffsetsPx[initialCharToRemove-1];
+ widthPx = charOffsetsPx[initialCharToRemove-1];
// the (initialCharToRemove-1)-th character is the first char of the string
-
+
wxASSERT(widthPx >= 0); // widthPx is zero for e.g. tab characters
// mark the (initialCharToRemove-1)-th character as removable
int removedPx;
if (initialCharToRemove >= 1)
removedPx = charOffsetsPx[initialCharToRemove+nCharsToRemove-1] - charOffsetsPx[initialCharToRemove-1];
- else
+ else
removedPx = charOffsetsPx[initialCharToRemove+nCharsToRemove-1];
wxASSERT(removedPx >= excessPx);
void wxDataViewIndexListModel::Reset( unsigned int new_size )
{
/* wxDataViewModel:: */ BeforeReset();
-
+
m_hash.Clear();
// IDs are ordered until an item gets deleted or inserted
/* wxDataViewModel:: */ BeforeReset();
m_size = new_size;
-
+
/* wxDataViewModel:: */ AfterReset();
}
wxDataViewChoiceRenderer( choices, mode, alignment )
{
}
-
+
wxControl* wxDataViewChoiceByIndexRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
{
wxVariant string_value = GetChoice( value.GetLong() );
-
+
return wxDataViewChoiceRenderer::CreateEditorCtrl( parent, labelRect, string_value );
}
wxVariant string_value = GetChoice( value.GetLong() );
return wxDataViewChoiceRenderer::SetValue( string_value );
}
-
+
bool wxDataViewChoiceByIndexRenderer::GetValue( wxVariant &value ) const
{
wxVariant string_value;
if (!wxDataViewChoiceRenderer::GetValue( string_value ))
return false;
-
+
value = (long) GetChoices().Index( string_value.GetString() );
return true;
}
// Ensure the scale matches the device
SetUserScale(1.0, 1.0);
-
+
if ( m_style & wxBUFFER_CLIENT_AREA )
GetDeviceOrigin(&x, &y);
{
return wxFileName::Rmdir(dir, flags);
}
-
+
#endif // wxUSE_LONGLONG
}
wxRealPoint::wxRealPoint(const wxPoint& pt)
- : x(pt.x), y(pt.y)
+ : x(pt.x), y(pt.y)
{
}
// that SetCurrent() can only be called for a shown window, so check for it
wxASSERT_MSG( IsShownOnScreen(), wxT("can't make hidden GL canvas current") );
-
+
return context.SetCurrent(*static_cast<const wxGLCanvas *>(this));
}
return false;
#ifdef wxHAS_OPENGL_ES
- wxGLAPI::glColor3f((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.),
+ wxGLAPI::glColor3f((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.),
(GLfloat) (col.Blue() / 256.));
#else
GLboolean isRGBA;
glGetBooleanv(GL_RGBA_MODE, &isRGBA);
if ( isRGBA )
{
- glColor3f((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.),
+ glColor3f((GLfloat) (col.Red() / 256.), (GLfloat) (col.Green() / 256.),
(GLfloat) (col.Blue() / 256.));
}
else // indexed colour
if ( desired )
glEnableClientState(flag);
else
- glDisableClientState(flag);
+ glDisableClientState(flag);
}
return former;
}
if ( desired )
glEnableClientState(flag);
else
- glDisableClientState(flag);
+ glDisableClientState(flag);
}
#endif
{
}
-void wxGLAPI::glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
+void wxGLAPI::glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
GLfloat top, GLfloat zNear, GLfloat zFar)
{
#if wxUSE_OPENGL_EMULATION
{
wxFAIL_MSG("nested glBegin");
}
-
+
s_mode = mode;
s_texCoordsUsed = false;
s_colorsUsed = false;
s_normalsUsed = false;
-
+
s_texCoords.clear();
s_normals.clear();
s_colors.clear();
{
wxFAIL_MSG("glTexCoord2f called outside glBegin/glEnd");
}
-
+
else
{
s_texCoordsUsed = true;
{
s_texCoords.push_back(s_currentTexCoord[0]);
s_texCoords.push_back(s_currentTexCoord[1]);
-
+
s_normals.push_back(s_currentNormal[0]);
s_normals.push_back(s_currentNormal[1]);
s_normals.push_back(s_currentNormal[2]);
-
+
s_colors.push_back(s_currentColor[0]);
s_colors.push_back(s_currentColor[1]);
s_colors.push_back(s_currentColor[2]);
s_colors.push_back(s_currentColor[3]);
-
+
s_vertices.push_back(x);
s_vertices.push_back(y);
s_vertices.push_back(z);
else
{
s_normalsUsed = true;
- s_currentNormal[0] = nx;
- s_currentNormal[1] = ny;
- s_currentNormal[2] = nz;
+ s_currentNormal[0] = nx;
+ s_currentNormal[1] = ny;
+ s_currentNormal[2] = nz;
}
#else
::glNormal3f(nx,ny,nz);
void wxGLAPI::glColor3f(GLfloat r, GLfloat g, GLfloat b)
{
#if wxUSE_OPENGL_EMULATION
- glColor4f(r,g,b,1.0);
+ glColor4f(r,g,b,1.0);
#else
::glColor3f(r,g,b);
#endif
bool formerNormals = SetState( GL_NORMAL_ARRAY, s_normalsUsed );
bool formerTexCoords = SetState( GL_TEXTURE_COORD_ARRAY, s_texCoordsUsed );
bool formerVertex = glIsEnabled(GL_VERTEX_ARRAY);
-
+
if( !formerVertex )
glEnableClientState(GL_VERTEX_ARRAY);
-
+
if ( s_colorsUsed )
glColorPointer( 4, GL_FLOAT, 0, &s_colors[0] );
-
+
if ( s_normalsUsed )
glNormalPointer( GL_FLOAT, 0, &s_normals[0] );
-
+
if ( s_texCoordsUsed )
glTexCoordPointer( 2, GL_FLOAT, 0, &s_texCoords[0] );
-
+
glVertexPointer(3, GL_FLOAT, 0, &s_vertices[0]);
glDrawArrays( s_mode, 0, s_vertices.size() / 3 );
-
+
if ( s_colorsUsed != formerColors )
RestoreState( GL_COLOR_ARRAY, formerColors );
-
+
if ( s_normalsUsed != formerNormals )
RestoreState( GL_NORMAL_ARRAY, formerColors );
-
+
if ( s_texCoordsUsed != formerTexCoords )
RestoreState( GL_TEXTURE_COORD_ARRAY, formerColors );
-
+
if( !formerVertex )
glDisableClientState(GL_VERTEX_ARRAY);
-
+
s_mode = 0xFF;
#else
::glEnd();
wxString wxStaticTextBase::GetLabelText(const wxString& label)
{
wxString ret = RemoveMarkup(label);
- // always remove the markup (this function is static
+ // always remove the markup (this function is static
// and cannot check for wxST_MARKUP presence/absence)
return RemoveMnemonics(ret);
m_sort = false;
m_sortAscending = true;
}
-
+
void wxDataViewColumn::UpdateDisplay()
{
if (m_owner)
else if ( align & wxALIGN_BOTTOM )
rectItem.y += cell_rect.height - size.y;
// else: wxALIGN_TOP is the default
- }
+ }
}
wxPoint pos( event.GetPosition() );
if (column==col)
return i;
}
-
+
return wxNOT_FOUND;
#else
// This returns the position in pixels which is not what we want.
// Unselect all rows before select another in the single select mode
if (m_clientArea->IsSingleSel())
m_clientArea->SelectAllRows(false);
-
+
m_clientArea->SelectRow(row, true);
-
+
// Also set focus to the selected item
m_clientArea->ChangeCurrentRow( row );
}
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(id);
return data->m_path;
}
-
+
return wxEmptyString;
}
wxPaintDC dc(this);
#ifdef __WXOSX__
// as subpanels might have a transparent background we must erase the background
- // at least on OSX, otherwise traces of the sash will remain
+ // at least on OSX, otherwise traces of the sash will remain
// test with: splitter sample->replace right window
dc.Clear();
#endif
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
// Maemo-specific method: get the main program object
HildonProgram *wxApp::GetHildonProgram()
-{
- return hildon_program_get_instance();
+{
+ return hildon_program_get_instance();
}
-
+
#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2
void wxBitmap::SetPixbuf(GdkPixbuf* pixbuf)
{
UnRef();
-
+
if (!pixbuf)
return;
// the right insertion point
if (m_strings)
n = m_strings->Add(items[i]);
-
+
GTKInsertComboBoxTextItem( n, items[i] );
m_clientData.Insert( NULL, n );
m_parent->DoAddChild( this );
PostCreation(size);
-
+
// we should blend into our parent background
const wxColour bg = parent->GetBackgroundColour();
SetBackgroundColour(bg);
windows.Add( m_widget->window );
return NULL;
-}
+}
#endif // wxUSE_COLLPANE && !defined(__WXUNIVERSAL__)
#if wxUSE_LIBHILDON
m_widget = hildon_color_selector_new(parentGTK);
-#elif wxUSE_LIBHILDON2 // !wxUSE_LIBHILDON
+#elif wxUSE_LIBHILDON2 // !wxUSE_LIBHILDON
m_widget = hildon_color_chooser_dialog_new();
#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
wxString title(_("Choose colour"));
int GetIndexOf( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual void OnInternalIdle();
-
+
protected:
void InitTree();
void ScheduleRefresh();
-
+
wxGtkTreeModelNode *FindNode( const wxDataViewItem &item );
wxGtkTreeModelNode *FindNode( GtkTreeIter *iter );
wxGtkTreeModelNode *FindParentNode( const wxDataViewItem &item );
GtkTargetEntry m_dropTargetTargetEntry;
wxCharBuffer m_dropTargetTargetEntryTarget;
wxDataObject *m_dropDataObject;
-
+
wxGtkDataViewModelNotifier *m_notifier;
-
+
bool m_dirty;
};
virtual void Resort();
virtual bool BeforeReset();
virtual bool AfterReset();
-
+
void UpdateLastCount();
private:
bool wxGtkDataViewModelNotifier::ItemChanged( const wxDataViewItem &item )
{
GtkWxTreeModel *wxgtk_model = m_internal->GetGtkModel();
-
+
GtkTreeIter iter;
iter.stamp = wxgtk_model->stamp;
iter.user_data = (gpointer) item.GetID();
{
GtkWxTreeModel *wxgtk_model = m_internal->GetGtkModel();
wxDataViewCtrl *ctrl = m_internal->GetOwner();
-
+
// This adds GTK+'s missing MVC logic for ValueChanged
unsigned int index;
for (index = 0; index < ctrl->GetColumnCount(); index++)
{
GtkWidget *treeview = m_internal->GetOwner()->GtkGetTreeView();
GtkWxTreeModel *wxgtk_model = m_internal->GetGtkModel();
-
- m_internal->Cleared();
-
+
+ m_internal->Cleared();
+
gtk_tree_view_set_model( GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(wxgtk_model) );
-
+
return true;
}
bool wxGtkDataViewModelNotifier::Cleared()
{
GtkWxTreeModel *wxgtk_model = m_internal->GetGtkModel();
-
+
// There is no call to tell the model that everything
// has been deleted so call row_deleted() for every
// child of root...
int count = m_internal->iter_n_children( NULL ); // number of children of root
-
+
GtkTreePath *path = gtk_tree_path_new_first(); // points to root
int i;
for (i = 0; i < count; i++)
gtk_tree_model_row_deleted( GTK_TREE_MODEL(wxgtk_model), path );
-
+
gtk_tree_path_free( path );
-
+
m_internal->Cleared();
return true;
wxDataViewChoiceRenderer( choices, mode, alignment )
{
}
-
+
void wxDataViewChoiceByIndexRenderer::GtkOnTextEdited(const gchar *itempath, const wxString& str)
{
wxVariant value( (long) GetChoices().Index( str ) );
wxVariant string_value = GetChoice( value.GetLong() );
return wxDataViewChoiceRenderer::SetValue( string_value );
}
-
+
bool wxDataViewChoiceByIndexRenderer::GetValue( wxVariant &value ) const
{
wxVariant string_value;
if (!wxDataViewChoiceRenderer::GetValue( string_value ))
return false;
-
+
value = (long) GetChoices().Index( string_value.GetString() );
return true;
}
{
if (m_isConnected)
return;
-
+
if (GTK_WIDGET_REALIZED(GetOwner()->m_treeview))
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
G_CALLBACK (gtk_dataview_header_button_press_callback), this);
// otherwise the event will be blocked by GTK+
- gtk_tree_view_column_set_clickable( column, TRUE );
-
+ gtk_tree_view_column_set_clickable( column, TRUE );
+
m_isConnected = true;
}
}
{
m_owner = owner;
m_wx_model = wx_model;
-
+
m_gtk_model = NULL;
m_root = NULL;
m_sort_order = GTK_SORT_ASCENDING;
m_dropDataObject = NULL;
m_dirty = false;
-
+
m_gtk_model = wxgtk_tree_model_new();
m_gtk_model->internal = this;
if (!m_wx_model->IsVirtualListModel())
InitTree();
-
+
gtk_tree_view_set_model( GTK_TREE_VIEW(m_owner->GtkGetTreeView()), GTK_TREE_MODEL(m_gtk_model) );
}
{
m_wx_model->RemoveNotifier( m_notifier );
- // remove the model from the GtkTreeView before it gets destroyed
+ // remove the model from the GtkTreeView before it gets destroyed
gtk_tree_view_set_model( GTK_TREE_VIEW( m_owner->GtkGetTreeView() ), NULL );
g_object_unref( m_gtk_model );
{
wxDataViewItemArray children;
unsigned int count = m_wx_model->GetChildren( node->GetItem(), children );
-
+
unsigned int pos;
for (pos = 0; pos < count; pos++)
{
delete m_root;
m_root = NULL;
}
-
+
InitTree();
-
+
ScheduleRefresh();
-
+
return true;
}
{
if (!m_wx_model->IsVirtualListModel())
m_root->Resort();
-
+
ScheduleRefresh();
}
}
ScheduleRefresh();
-
+
return true;
}
}
ScheduleRefresh();
-
+
return true;
}
while (node)
{
int pos = node->GetChildren().Index( id );
-
+
gtk_tree_path_prepend_index( retval, pos );
id = node->GetItem().GetID();
void wxDataViewCtrl::OnInternalIdle()
{
wxWindow::OnInternalIdle();
-
+
m_internal->OnInternalIdle();
unsigned int cols = GetColumnCount();
wxDataViewColumn *col = GetColumn( i );
col->OnInternalIdle();
}
-
+
if (m_ensureVisibleDefered.IsOk())
{
ExpandAncestors(m_ensureVisibleDefered);
case GDK_ACTION_MOVE:
return wxDragMove;
}
-
+
return wxDragNone;
}
wxDragResult suggested_action = drop_target->GTKFigureOutSuggestedAction();
wxDragResult result = wxDragNone;
-
+
if (drop_target->m_firstMotion)
{
// the first "drag_motion" event substitutes a "drag_enter" event
result_action = GDK_ACTION_LINK;
else
result_action = GDK_ACTION_MOVE;
-
+
// is result action actually supported
bool ret ((result_action != GDK_ACTION_DEFAULT) &&
(context->actions & result_action));
-
+
if (ret)
gdk_drag_status( context, result_action, time );
// after this, invalidate the drop_target's GdkDragContext
drop_target->GTKSetDragContext( NULL );
- // this has to be done because GDK has no "drag_enter" event
+ // this has to be done because GDK has no "drag_enter" event
drop_target->m_firstMotion = false;
return ret;
{
// cancel the whole thing
gtk_drag_finish( context,
- FALSE, // no success
+ FALSE, // no success
FALSE, // don't delete data on dropping side
time );
-
+
drop_target->GTKSetDragContext( NULL );
-
+
drop_target->m_firstMotion = true;
-
+
return FALSE;
}
{
if (!m_dragContext)
return wxDragError;
-
+
// GTK+ always supposes that we want to copy the data by default while we
// might want to move it, so examine not only suggested_action - which is
// only good if we don't have our own preferences - but also the actions
{
// this function looks like GTKSetLabelForLabel() but here we just want to modify
// the GTK control without altering any internal wxStaticText variable
-
+
const wxString labelGTK = GTKConvertMnemonics(str);
gtk_label_set_text_with_mnemonic(GTK_LABEL(m_widget), wxGTK_CONV(labelGTK));
}
// NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)
attrs.colBg = wnd->MSWGetThemeColour(L"EDIT",
- EP_EDITTEXT,
+ EP_EDITTEXT,
ETS_NORMAL,
ThemeColourBackground,
wxSYS_COLOUR_WINDOW);
bool wxListCtrl::DeleteAllItems()
{
// Calling ListView_DeleteAllItems() will always generate an event but we
- // shouldn't do it if the control is empty
+ // shouldn't do it if the control is empty
return !GetItemCount() || ListView_DeleteAllItems(GetHwnd()) != 0;
}
}
#endif // SS_ENDELLIPSIS
- // save the label in m_labelOrig with both the markup (if any) and
+ // save the label in m_labelOrig with both the markup (if any) and
// the mnemonics characters (if any)
m_labelOrig = label;
void wxButton::DoSetBitmap(const wxBitmap& bitmap, State which)
{
m_bitmaps[which] = bitmap;
-
+
if ( which == State_Normal )
m_peer->SetBitmap(bitmap);
else if ( which == State_Pressed )
void wxButton::OnEnterWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
- m_peer->SetBitmap( DoGetBitmap( State_Current ) );
+ m_peer->SetBitmap( DoGetBitmap( State_Current ) );
}
void wxButton::OnLeaveWindow( wxMouseEvent& WXUNUSED(event))
{
if ( DoGetBitmap( State_Current ).IsOk() )
- m_peer->SetBitmap( DoGetBitmap( State_Normal ) );
+ m_peer->SetBitmap( DoGetBitmap( State_Normal ) );
}
bool wxButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
void SetPressedBitmap( const wxBitmap& WXUNUSED(bitmap) )
{
// not implemented under Carbon
- }
-
+ }
+
private:
// helper function: returns true if the given bitmap is of one of standard
// sizes supported by OS X icons
{
if (m_text)
return m_text->GetTextPeer();
-
+
return NULL;
}
{
m_err = noErr ;
wxOSXPrintData *native = (wxOSXPrintData*) data->GetNativeData() ;
-
+
PMRect rPage;
m_err = PMGetAdjustedPageRect(native->GetPageFormat(), &rPage);
if ( m_err != noErr )
return;
-
+
m_maxX = wxCoord(rPage.right - rPage.left) ;
m_maxY = wxCoord(rPage.bottom - rPage.top);
-
+
PMResolution res;
PMPrinter printer;
m_err = PMSessionGetCurrentPrinter(native->GetPrintSession(), &printer);
if ( m_err == noErr )
- {
+ {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( PMPrinterGetOutputResolution != NULL )
{
#endif
}
}
-
+
m_maxX = wxCoord((double)m_maxX * res.hRes / 72.0);
m_maxY = wxCoord((double)m_maxY * res.vRes / 72.0);
#endif
}
}
-
+
m_maxX = wxCoord((double)m_maxX * res.hRes / 72.0);
m_maxY = wxCoord((double)m_maxY * res.vRes / 72.0);
// Core Graphics initially has the lower left of the paper as 0,0
if ( !m_err )
CGContextTranslateCTM( pageContext , (CGFloat) -paperRect.left , (CGFloat) paperRect.bottom ) ;
-
+
// since this is a non-critical error, we set the flag back
m_err = noErr ;
wxASSERT_MSG(image, wxT("wxScreenDC::GetAsBitmap - unable to get screenshot."));
CGContextDrawImage(context, srcRect, image);
-
+
CGImageRelease(image);
CGContextRestoreGState(context);
void wxDialog::DoShowWindowModal()
{
- // If someone wants to add support for this to wxOSX Carbon, here would
+ // If someone wants to add support for this to wxOSX Carbon, here would
// be the place to start: http://trac.wxwidgets.org/ticket/9459
// Unfortunately, supporting sheets in Carbon isn't as straightforward
// as with Cocoa, so it will probably take some tweaking.
int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout)
{
wxMacAutoreleasePool autoreleasepool;
-
+
EventRef event;
OSStatus status = ReceiveNextEvent(0, NULL, timeout/1000, true, &event);
switch ( status )
WindowGroupRef windowGroup = NULL;
WindowGroupRef formerParentGroup = NULL;
-
+
// make sure modal dialogs are in the right layer so that they are not covered
if ( m_modalWindow != NULL )
{
}
m_modalWindow->SetFocus();
-
+
RunAppModalLoopForWindow(m_modalNativeWindow);
if ( resetGroupParent )
{
public:
OpenUserDataRec( wxFileDialog* dialog );
-
+
bool FilterCallback( AEDesc *theItem, void *info, NavFilterModes filterMode );
void EventProc( NavEventCallbackMessage inSelector, NavCBRecPtr ioParams );
int GetCurrentFilter() const {return m_currentfilter;}
CFArrayRef GetMenuItems() const { return m_menuitems;}
-
-
+
+
private:
void EventProcCBEvent( NavCBRecPtr ioParams );
void EventProcCBEventMouseDown( NavCBRecPtr ioParams);
void EventProcCBAdjustRect( NavCBRecPtr ioParams );
bool CheckFile( const wxString &filename , OSType type);
void MakeUserDataRec( const wxString& filter);
-
+
wxFileDialog* m_dialog;
int m_currentfilter;
wxString m_defaultLocation;
m_dialog = d;
m_controlAdded = false;
m_saveMode = m_dialog->HasFdFlag(wxFD_SAVE);
-
+
m_defaultLocation = m_dialog->GetDirectory();
MakeUserDataRec(m_dialog->GetWildcard());
m_currentfilter = m_dialog->GetFilterIndex();
-
+
m_menuitems = NULL;
-
+
size_t numFilters = m_extensions.GetCount();
if (numFilters)
{
EventProcCBEventMouseDown(callBackParms);
break;
}
- }
+ }
}
void OpenUserDataRec::EventProcCBEventMouseDown(NavCBRecPtr callBackParms)
EventRecord *evt = callBackParms->eventData.eventDataParms.event;
Point where = evt->where;
QDGlobalToLocalPoint(GetWindowPort(callBackParms->window), &where);
-
+
ControlRef whichControl = FindControlUnderMouse(where, callBackParms->window, NULL);
if (whichControl != NULL)
{
ControlKind theKind;
GetControlKind(whichControl, &theKind);
-
+
// Moving the focus if we clicked in an focusable control
- if ((theKind.kind == kControlKindEditUnicodeText) ||
- (theKind.kind == kControlKindEditText) ||
- (theKind.kind == kControlKindDataBrowser) ||
+ if ((theKind.kind == kControlKindEditUnicodeText) ||
+ (theKind.kind == kControlKindEditText) ||
+ (theKind.kind == kControlKindDataBrowser) ||
(theKind.kind == kControlKindListBox))
{
ControlRef currentlyFocusedControl;
if (noErr == ::AECreateDesc(typeFSRef, &theFile, sizeof(FSRef), &theLocation))
::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation);
}
-
+
if( m_extensions.GetCount() > 0 )
{
NavMenuItemSpec menuItem;
menuItem.menuType = m_currentfilter;
::NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &menuItem);
}
-
+
if (m_dialog->GetExtraControl())
{
m_controlAdded = true;
ControlRef ref = m_dialog->GetExtraControl()->GetPeer()->GetControlRef();
NavCustomControl(ioParams->context, kNavCtlAddControl, ref);
}
-
+
}
void OpenUserDataRec::EventProcCBPopupMenuSelect(NavCBRecPtr ioParams)
{
NavMenuItemSpec * menu = (NavMenuItemSpec *) ioParams->eventData.eventDataParms.param ;
const size_t numFilters = m_extensions.GetCount();
-
+
if ( menu->menuType < numFilters )
{
m_currentfilter = menu->menuType ;
if ( m_saveMode )
{
int i = menu->menuType ;
-
+
// isolate the first extension string
wxString firstExtension = m_extensions[i].BeforeFirst('|').BeforeFirst(';');
-
+
wxString extension = firstExtension.AfterLast('.') ;
wxString sfilename ;
-
+
wxCFStringRef cfString( wxCFRetain( NavDialogGetSaveFileName( ioParams->context ) ) );
sfilename = cfString.AsString() ;
-
+
int pos = sfilename.Find('.', true) ;
if ( pos != wxNOT_FOUND && extension != wxT("*") )
{
void OpenUserDataRec::EventProcCBCustomize(NavCBRecPtr ioParams)
{
wxWindow* control = m_dialog->GetExtraControl();
-
+
if ( control )
{
SInt16 neededRight, neededBottom;
-
+
wxSize size = m_dialog->GetExtraControl()->GetSize();
neededRight = ioParams->customRect.left + size.x;
neededBottom = ioParams->customRect.top + size.y;
-
+
if (ioParams->customRect.right == 0 && ioParams->customRect.bottom == 0)
{
ioParams->customRect.right = neededRight;
ioParams->customRect.bottom = neededBottom;
}
- else
+ else
{
if ( ioParams->customRect.right != m_lastRight )
{
void OpenUserDataRec::EventProcCBAdjustRect(NavCBRecPtr ioParams)
{
wxWindow* control = m_dialog->GetExtraControl();
-
+
if ( control && m_controlAdded)
{
- control->SetSize(ioParams->customRect.left , ioParams->customRect.top,
+ control->SetSize(ioParams->customRect.left , ioParams->customRect.top,
ioParams->customRect.right - ioParams->customRect.left,
ioParams->customRect.bottom - ioParams->customRect.top);
}
// check if a folder is a package before deciding what to do.
NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ;
FSRef fsref;
-
+
if ( theInfo->isFolder )
{
// check bundle bit (using Finder Services - used by OS9 on some bundles)
FSCatalogInfo catalogInfo;
if (FSGetCatalogInfo (&fsref, kFSCatInfoFinderInfo, &catalogInfo, NULL, NULL, NULL) != noErr)
return true;
-
+
// Check bundle item (using Launch Services - used by OS-X through info.plist or APP)
LSItemInfoRecord lsInfo;
if (LSCopyItemInfoForRef(&fsref, kLSRequestBasicFlagsOnly, &lsInfo ) != noErr)
return true;
-
+
// If it's not a bundle, then it's a normal folder and it passes our filter
FileInfo *fileInfo = (FileInfo *) catalogInfo.finderInfo;
if ( !(fileInfo->finderFlags & kHasBundle) &&
}
}
}
-
+
return true;
}
void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
{
wxTopLevelWindow::Create( GetParent(), nativeWindow );
-
+
if (HasExtraControlCreator())
{
CreateExtraControl();
{
m_paths.Empty();
m_fileNames.Empty();
-
+
OSErr err;
NavDialogCreationOptions dialogCreateOptions;
NavDialogRef dialog;
NavObjectFilterUPP navFilterUPP = NULL;
OpenUserDataRec myData( this );
-
+
dialogCreateOptions.popupExtension = myData.GetMenuItems();
-
+
if (HasFdFlag(wxFD_SAVE))
{
dialogCreateOptions.optionFlags |= kNavDontAutoTranslate;
(void *) &myData, // inClientData
&dialog );
}
-
+
SetupExtraControls(NavDialogGetWindow(dialog));
-
+
if (err == noErr)
{
wxDialog::OSXBeginModalDialog();
{
CTFontSymbolicTraits remainingTraits = traits;
const CGAffineTransform* remainingTransform = NULL;
-
+
if( remainingTraits & kCTFontItalicTrait )
{
remainingTraits &= ~kCTFontItalicTrait;
}
}
}
-
+
if ( fontWithTraits == NULL )
{
fontWithTraits = CTFontCreateWithName( wxCFStringRef(m_info.m_faceName), m_info.m_pointSize, remainingTransform );
}
-
+
}
if ( fontWithTraits != NULL )
m_ctFont.reset(fontWithTraits);
}
}
}
-
+
m_cgFont.reset(CTFontCopyGraphicsFont(m_ctFont, NULL));
}
UIFont* wxFont::OSXGetUIFont() const
{
wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
-
+
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
-
+
return (M_FONTDATA->m_uiFont);
}
m_userOffset = CGContextConvertSizeToUserSpace( m_cg, CGSizeMake( 0.5 , 0.5 ) );
CGContextTranslateCTM( m_cg, m_userOffset.width , m_userOffset.height );
}
- else
+ else
{
m_userOffset = CGSizeMake(0.0, 0.0);
}
WXUNUSED_UNLESS_DEBUG( OSStatus status = ) m_dbImpl->GetItemPartBounds( id, kMinColumnId + column, kDataBrowserPropertyEnclosingPart, &enclosingRect );
wxASSERT( status == noErr );
-
+
enclosingCGRect = CGRectMake(enclosingRect.left,
enclosingRect.top,
enclosingRect.right - enclosingRect.left,
enclosingRect.bottom - enclosingRect.top);
-
+
if (column >= 0)
{
if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) )
if (lcItem->HasColumnInfo(column))
{
wxListItem* item = lcItem->GetColumnInfo(column);
-
+
if (item->GetMask() & wxLIST_MASK_IMAGE)
{
imgIndex = item->GetImage();
}
}
}
-
+
calculateCGDrawingBounds(enclosingCGRect, &iconCGRect, &textCGRect, (imgIndex != -1) );
-
+
if ( CGRectContainsPoint( iconCGRect, click_point ) )
{
flags = wxLIST_HITTEST_ONITEMICON;
//
// if the extended text is not empty we ignore the caption
// and use the message and the extended message
-
-
+
+
wxString msgtitle,msgtext;
if(m_extendedMessage.IsEmpty())
{
}
}
}
-
+
SetReturnCode(resultbutton);
return resultbutton;
event.SetEventObject(this);
HandleWindowEvent(event);
}
-
+
return true;
}
{
return win->MacGetCGContextRef() != NULL ||
// wxMemoryDC's also have a valid CGContext.
- dc.IsKindOf( CLASSINFO(wxMemoryDC) );
+ dc.IsKindOf( CLASSINFO(wxMemoryDC) );
}
if ( hasMetal )
HIThemeDrawBackground(&splitterRect, &bgdrawInfo, cgContext, kHIThemeOrientationNormal);
- else
+ else
{
CGContextSetFillColorWithColor(cgContext,win->GetBackgroundColour().GetCGColor());
CGContextFillRect(cgContext,splitterRect);
}
-
+
HIThemeSplitterDrawInfo drawInfo;
drawInfo.version = 0;
drawInfo.state = kThemeStateActive;
public:
wxOSXSoundManagerSoundData(const wxString& fileName);
~wxOSXSoundManagerSoundData();
-
+
virtual bool Play(unsigned flags);
virtual void SoundTask();
void DoStop();
protected:
- SndListHandle m_hSnd;
+ SndListHandle m_hSnd;
SndChannelPtr m_pSndChannel;
};
wxOSXSoundManagerSoundData::wxOSXSoundManagerSoundData(const wxString& fileName) :
m_pSndChannel(NULL)
-{
+{
Str255 lpSnd ;
-
+
wxMacStringToPascal( fileName , lpSnd ) ;
-
+
m_hSnd = (SndListHandle) GetNamedResource('snd ', (const unsigned char *) lpSnd);
}
m_pSndChannel = NULL;
wxSound::SoundStopped(this);
}
-
+
if (IsMarkedForDeletion())
delete this;
}
SoundComponentData data;
unsigned long numframes, offset;
-
+
ParseSndHeader((SndListHandle)m_hSnd, &data, &numframes, &offset);
SndNewChannel(&m_pSndChannel, sampledSynth,
initNoInterp
+ (data.numChannels == 1 ? initMono : initStereo), NULL);
-
+
if(SndPlay(m_pSndChannel, (SndListHandle) m_hSnd, flags & wxSOUND_ASYNC ? 1 : 0) != noErr)
return false;
-
+
if (flags & wxSOUND_ASYNC)
CreateAndStartTimer();
else
DoStop();
-
+
return true;
}
void wxOSXSoundManagerSoundData::SoundTask()
{
SCStatus stat;
-
+
if (SndChannelStatus((SndChannelPtr)m_pSndChannel, sizeof(SCStatus), &stat) != 0)
Stop();
-
+
//if the sound isn't playing anymore, see if it's looped,
//and if so play it again, otherwise close things up
if (stat.scChannelBusy == FALSE)
//Note that ExitMovies() is not necessary, but
//the docs are fuzzy on whether or not TerminateQTML is
ExitMovies();
-
+
#ifndef __WXMAC__
TerminateQTML();
#endif
wxOSXQuickTimeSoundData(const wxString& fileName);
wxOSXQuickTimeSoundData(int size, const wxByte* data);
~wxOSXQuickTimeSoundData();
-
+
virtual bool Play(unsigned flags);
virtual void SoundTask();
virtual void DoStop();
protected:
Movie m_movie;
-
+
wxString m_sndname; //file path
Handle m_soundHandle;
};
wxOSXQuickTimeSoundData::wxOSXQuickTimeSoundData(const wxString& fileName) :
m_movie(NULL), m_soundHandle(NULL)
-{
+{
m_sndname = fileName;
}
wxOSXQuickTimeSoundData::wxOSXQuickTimeSoundData(int size, const wxByte* data) :
m_movie(NULL)
-{
+{
m_soundHandle = NewHandleClear((Size)size);
BlockMove(data, *m_soundHandle, size);
}
{
if ( m_movie )
Stop();
-
+
m_flags = flags;
-
+
if (!wxInitQT())
return false;
long outFlags = 0;
OSErr err;
ComponentResult result;
-
+
err = PtrToHand(&m_soundHandle, &dataRef, sizeof(Handle));
-
+
HLock(m_soundHandle);
if (memcmp(&(*m_soundHandle)[8], "WAVE", 4) == 0)
miComponent = OpenDefaultComponent(MovieImportType, kQTFileTypeWave);
wxLogSysError(wxT("wxSound - Location in memory does not contain valid data"));
return false;
}
-
+
HUnlock(m_soundHandle);
m_movie = NewMovie(0);
-
+
result = MovieImportDataRef(miComponent, dataRef,
HandleDataHandlerSubType, m_movie,
nil, &targetTrack,
nil, &addedDuration,
movieImportCreateTrack, &outFlags);
-
+
if (result != noErr)
{
wxLogSysError(wxString::Format(wxT("Couldn't import movie data\nError:%i"), (int)result));
}
-
+
SetMovieVolume(m_movie, kFullVolume);
GoToBeginningOfMovie(m_movie);
}
else
{
OSErr err = noErr ;
-
+
Handle dataRef = NULL;
OSType dataRefType;
-
+
err = QTNewDataReferenceFromFullPathCFString(wxCFStringRef(m_sndname,wxLocale::GetSystemEncoding()),
(UInt32)kQTNativeDefaultPathStyle, 0, &dataRef, &dataRefType);
-
+
wxASSERT(err == noErr);
-
+
if (NULL != dataRef || err != noErr)
{
err = NewMovieFromDataRef( &m_movie, newMovieDontAskUnresolvedDataRefs , NULL, dataRef, dataRefType );
wxASSERT(err == noErr);
DisposeHandle(dataRef);
}
-
+
if (err != noErr)
{
wxLogSysError(
return false;
}
}
-
+
//Start the m_movie!
StartMovie(m_movie);
-
+
if (flags & wxSOUND_ASYNC)
{
CreateAndStartTimer();
else
{
wxASSERT_MSG(!(flags & wxSOUND_LOOP), wxT("Can't loop and play syncronously at the same time"));
-
+
//Play movie until it ends, then exit
//Note that due to quicktime caching this may not always
//work 100% correctly
while (!IsMovieDone(m_movie))
MoviesTask(m_movie, 1);
-
+
DoStop();
}
-
+
return true;
}
{
if (!m_macToolbar)
return;
-
+
WindowRef tlw = MAC_WXHWND(MacGetTopLevelWindowRef());
if (tlw)
SetWindowToolbar( tlw, NULL );
x -= (int)parent.origin.x;
y -= (int)parent.origin.y;
}
-
+
}
void wxMacControl::GetSize( int &width, int &height ) const
OSStatus err = HIViewChangeFeatures(m_controlRef , kHIViewIsOpaque , 0);
verify_noerr( err );
}
-
+
return true ;
}
OffsetRect( r , (short) hiPoint.x , (short) hiPoint.y ) ;
}
}
-
+
void wxMacControl::GetBestRect( wxRect *rect ) const
{
short baselineoffset;
// the root control level handler
if ( !now->IsNativeWindowWrapper() )
contentview->InstallEventHandler() ;
-
+
return contentview;
}
{
m_cgColour.reset( col );
size_t noComp = CGColorGetNumberOfComponents( col );
-
+
const CGFloat *components = NULL;
if ( noComp >= 1 && noComp <= 4 )
{
m_red = m_green = m_blue = 0;
return;
}
-
+
if ( numComponents >= 3 )
{
m_red = (int)(components[0]*255+0.5);
{
CGDisplayErr error = kCGErrorSuccess;
CGDisplayCount onlineCount;
-
+
error = CGGetOnlineDisplayList(0,NULL,&onlineCount);
if ( error == kCGErrorSuccess )
{
{
if ( CGDisplayMirrorsDisplay(onlineDisplays[i]) != kCGNullDirectDisplay )
continue;
-
+
if ( displays == NULL )
*displayCount += 1;
else
}
delete[] onlineDisplays;
}
-
+
}
return error;
}
void wxMacWakeUp()
{
wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
-
+
if ( loop )
loop->WakeUp();
}
void wxOSXThreadModuleOnInit()
{
- gs_critsectWaitingForGui = new wxCriticalSection();
+ gs_critsectWaitingForGui = new wxCriticalSection();
gs_critsectGui = new wxCriticalSection();
gs_critsectGui->Enter();
}
gs_critsectGui->Enter();
gs_bGuiOwnedByMainThread = true;
}
-
+
gs_critsectGui->Leave();
wxDELETE(gs_critsectGui);
}
-
+
wxDELETE(gs_critsectWaitingForGui);
}
// this would dead lock everything...
wxASSERT_MSG( !wxThread::IsMain(),
wxT("main thread doesn't want to block in wxMutexGuiEnter()!") );
-
+
// the order in which we enter the critical sections here is crucial!!
-
+
// set the flag telling to the main thread that we want to do some GUI
{
wxCriticalSectionLocker enter(*gs_critsectWaitingForGui);
-
+
gs_nWaitingForGui++;
}
-
+
wxWakeUpMainThread();
-
+
// now we may block here because the main thread will soon let us in
// (during the next iteration of OnIdle())
gs_critsectGui->Enter();
void wxMutexGuiLeaveImpl()
{
wxCriticalSectionLocker enter(*gs_critsectWaitingForGui);
-
+
if ( wxThread::IsMain() )
{
gs_bGuiOwnedByMainThread = false;
// decrement the number of threads waiting for GUI access now
wxASSERT_MSG( gs_nWaitingForGui > 0,
wxT("calling wxMutexGuiLeave() without entering it first?") );
-
+
gs_nWaitingForGui--;
-
+
wxWakeUpMainThread();
}
-
+
gs_critsectGui->Leave();
}
{
wxASSERT_MSG( wxThread::IsMain(),
wxT("only main thread may call wxMutexGuiLeaveOrEnter()!") );
-
+
if ( !gs_critsectWaitingForGui )
return;
-
+
wxCriticalSectionLocker enter(*gs_critsectWaitingForGui);
-
+
if ( gs_nWaitingForGui == 0 )
{
// no threads are waiting for GUI - so we may acquire the lock without
if ( !wxGuiOwnedByMainThread() )
{
gs_critsectGui->Enter();
-
+
gs_bGuiOwnedByMainThread = true;
}
//else: already have it, nothing to do
// The remaining functionality has not yet been implemented for OS X
/////////////////////////////////////////////////////////////////////////////
-wxFileTypeImpl::wxFileTypeImpl()
+wxFileTypeImpl::wxFileTypeImpl()
{
}
-wxFileTypeImpl::~wxFileTypeImpl()
+wxFileTypeImpl::~wxFileTypeImpl()
{
}
// Query wxMimeTypesManagerImple to get real information for a file type
-bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) const
-{
- return m_manager->GetExtensions( m_uti, extensions );
+bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) const
+{
+ return m_manager->GetExtensions( m_uti, extensions );
}
-bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
-{
- return m_manager->GetMimeType( m_uti, mimeType );
+bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
+{
+ return m_manager->GetMimeType( m_uti, mimeType );
}
-bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
-{
- return m_manager->GetMimeTypes( m_uti, mimeTypes );
+bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
+{
+ return m_manager->GetMimeTypes( m_uti, mimeTypes );
}
-bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
-{
- return m_manager->GetIcon( m_uti, iconLoc );
+bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
+{
+ return m_manager->GetIcon( m_uti, iconLoc );
}
-bool wxFileTypeImpl::GetDescription(wxString *desc) const
-{
- return m_manager->GetDescription( m_uti, desc );
+bool wxFileTypeImpl::GetDescription(wxString *desc) const
+{
+ return m_manager->GetDescription( m_uti, desc );
}
bool wxFileTypeImpl::GetOpenCommand(wxString *WXUNUSED(openCmd), const wxFileType::MessageParameters& WXUNUSED(params)) const
{
PMPrinter printer;
PMSessionGetCurrentPrinter(m_macPrintSession, &printer);
-
+
wxSize papersize = wxDefaultSize;
const wxPaperSize paperId = data.GetPaperId();
if ( paperId != wxPAPER_NONE && wxThePrintPaperDatabase )
{
papersize = data.GetPaperSize();
}
-
+
if ( papersize != wxDefaultSize )
{
papersize.x = (wxInt32) (papersize.x * mm2pt);
papersize.y = (wxInt32) (papersize.y * mm2pt);
-
+
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
-
+
if ( fabs( width - papersize.x ) >= 5 ||
fabs( height - papersize.y ) >= 5 )
{
const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 };
wxString id, name(wxT("Custom paper"));
id.Printf(wxT("wxPaperCustom%dx%d"), papersize.x, papersize.y);
-
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( PMPaperCreateCustom != NULL)
{
}
}
}
-
+
PMSetCopies( m_macPrintSettings , data.GetNoCopies() , false ) ;
PMSetCollate(m_macPrintSettings, data.GetCollate());
if ( data.IsOrientationReversed() )
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
-
+
PMDuplexMode mode = 0 ;
switch( data.GetDuplex() )
{
break ;
}
PMSetDuplex( m_macPrintSettings, mode ) ;
-
-
+
+
if ( data.IsOrientationReversed() )
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMReverseLandscape : kPMReversePortrait , false ) ;
PMSetResolution( m_macPageFormat, &res);
#endif
}
-
+
free(resolutions);
}
}
TransferPrinterNameFrom(data);
TransferPaperInfoFrom(data);
TransferResolutionFrom(data);
-
+
// after setting the new resolution the format has to be updated, otherwise the page rect remains
// at the 'old' scaling
-
+
PMSessionValidatePageFormat(m_macPrintSession,
m_macPageFormat, kPMDontWantBoolean);
PMSessionValidatePrintSettings(m_macPrintSession,
err = PMGetCopies( m_macPrintSettings , &copies ) ;
if ( err == noErr )
data.SetNoCopies( copies ) ;
-
+
PMOrientation orientation ;
err = PMGetOrientation( m_macPageFormat , &orientation ) ;
if ( err == noErr )
data.SetOrientationReversed( orientation == kPMReverseLandscape );
}
}
-
+
Boolean collate;
if (PMGetCollate(m_macPrintSettings, &collate) == noErr)
data.SetCollate(collate);
-
-
+
+
PMDuplexMode mode = 0 ;
PMGetDuplex( m_macPrintSettings, &mode ) ;
switch( mode )
data.SetDuplex(wxDUPLEX_SIMPLEX);
break ;
}
-
+
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
-
+
wxSize sz((int)(width * pt2mm + 0.5 ) ,
(int)(height * pt2mm + 0.5 ));
data.SetPaperSize(sz);
data.SetQuality((((i + 1) * 3) / resCount) + wxPRINT_QUALITY_DRAFT);
}
free(resolutions);
- }
+ }
}
bool wxOSXPrintData::TransferTo( wxPrintData &data )
wxOSXAudioToolboxSoundData(const wxString& fileName);
~wxOSXAudioToolboxSoundData();
-
+
virtual bool Play(unsigned flags);
virtual void DoStop();
protected:
static void CompletionCallback(SystemSoundID mySSID, void * soundRef);
void SoundCompleted();
-
- SystemSoundID m_soundID;
+
+ SystemSoundID m_soundID;
wxString m_sndname; //file path
};
wxOSXAudioToolboxSoundData::wxOSXAudioToolboxSoundData(const wxString& fileName) :
m_soundID(NULL)
-{
+{
m_sndname = fileName;
}
void * soundRef)
{
wxOSXAudioToolboxSoundData* data = (wxOSXAudioToolboxSoundData*) soundRef;
-
+
data->SoundCompleted();
-
+
if (data->IsMarkedForDeletion())
delete data;
}
{
if (m_flags & wxSOUND_LOOP)
AudioServicesPlaySystemSound(m_soundID);
- else
+ else
Stop();
}
- else
+ else
{
Stop();
CFRunLoopStop(CFRunLoopGetCurrent());
{
AudioServicesDisposeSystemSoundID (m_soundID);
m_soundID = NULL;
-
+
wxSound::SoundStopped(this);
}
}
Stop();
m_flags = flags;
-
+
wxCFRef<CFMutableStringRef> cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(m_sndname)));
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
wxCFRef<CFURLRef> url(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false));
if ( sync )
{
- while( m_soundID )
+ while( m_soundID )
{
CFRunLoopRun();
}
}
-
+
return true;
}
bool wxSound::Create(const wxString& fileName, bool isResource)
{
wxCHECK_MSG( !isResource, false, "not implemented" );
-
+
m_data = new wxOSXAudioToolboxSoundData(fileName);
return true;
}
// nothing to do
return false;
}
- else
+ else
{
if ( !wxDialogBase::Show(show) )
// nothing to do
{
case wxDIALOG_MODALITY_WINDOW_MODAL:
EndWindowModal(); // OS X implementation method for cleanup
- SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
+ SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
break;
default:
break;
}
m_modality = wxDIALOG_MODALITY_NONE;
}
-
+
return true;
}
int wxDialog::ShowModal()
{
m_modality = wxDIALOG_MODALITY_APP_MODAL;
-
+
Show();
wxModalEventLoop modalLoop(this);
m_eventLoop = &modalLoop;
-
+
wxDialog::OSXBeginModalDialog();
modalLoop.Run();
wxDialog::OSXEndModalDialog();
-
+
m_eventLoop = NULL;
-
+
return GetReturnCode();
}
void wxDialog::ShowWindowModal()
{
m_modality = wxDIALOG_MODALITY_WINDOW_MODAL;
-
+
Show();
-
+
DoShowWindowModal();
}
{
if ( m_eventLoop )
m_eventLoop->Exit(retCode);
-
+
SetReturnCode(retCode);
Show(false);
}
wxNonOwnedWindow* wxNonOwnedWindow::GetFromWXWindow( WXWindow win )
{
wxNonOwnedWindowImpl* impl = wxNonOwnedWindowImpl::FindFromWXWindow(win);
-
+
return ( impl != NULL ? impl->GetWXPeer() : NULL ) ;
}
wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::FindFromWXWindow (WXWindow window)
{
MacWindowMap::iterator node = wxWinMacWindowList.find(window);
-
+
return (node == wxWinMacWindowList.end()) ? NULL : node->second;
}
// adding NULL WindowRef is (first) surely a result of an error and
// nothing else :-)
wxCHECK_RET( window != (WXWindow) NULL, wxT("attempt to add a NULL WindowRef to window list") );
-
+
wxWinMacWindowList[window] = impl;
}
{
if ( parent )
parent->AddChild(this);
-
+
SubclassWin(nativeWindow);
-
+
return true;
}
if ( GetParent() )
GetParent()->RemoveChild(this);
-
- wxNonOwnedWindowImpl::RemoveAssociations(m_nowpeer) ;
+
+ wxNonOwnedWindowImpl::RemoveAssociations(m_nowpeer) ;
wxDELETE(m_nowpeer);
wxDELETE(m_peer);
m_isNativeWindowWrapper = false;
bool wxNonOwnedWindow::Destroy()
{
WillBeDestroyed();
-
+
return wxWindow::Destroy();
}
{
if (flags == GetWindowStyleFlag())
return;
-
+
wxWindow::SetWindowStyleFlag(flags);
-
+
if (m_nowpeer)
m_nowpeer->SetWindowStyleFlag(flags);
}
int left, top, w, h;
m_nowpeer->GetContentArea(left, top, w, h);
-
+
if (width)
*width = w ;
if (height)
wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
m_shape = region;
-
+
// The empty region signifies that the shape
// should be removed from the window.
if ( region.IsEmpty() )
// Name: src/osx/sound_osx.cpp
// Purpose: wxSound class common osx code
// Author: Stefan Csomor
-// Modified by:
+// Modified by:
// Created: 2009-09-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
: m_sound(snd)
{
}
-
+
virtual ~wxSoundTimer()
{
Stop();
if (m_sound)
m_sound->DoStop();
}
-
+
void Notify()
{
if (m_sound)
m_sound->SoundTask();
}
-
+
protected:
wxSoundData* m_sound;
};
m_pTimer->Start(MOVIE_DELAY, wxTIMER_CONTINUOUS);
}
-wxSound::wxSound()
+wxSound::wxSound()
{
Init();
}
break;
}
}
-
+
if (isPlaying)
m_data->MarkForDeletion();
else
if ( !m_data->Play(flags) )
s_soundsPlaying.pop_back();
}
-
+
return false;
}
for ( wxVector<wxSoundData*>::iterator s = s_soundsPlaying.begin();
s != s_soundsPlaying.end(); ++s )
{
- if ( (*s) == data )
+ if ( (*s) == data )
{
s_soundsPlaying.erase(s);
break;
m_peer = wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() );
MacPostControlCreate(pos, size) ;
-
+
#if wxOSX_USE_COCOA
// under carbon everything can already be set before the MacPostControlCreate embedding takes place
// but under cocoa for single line textfields this only works after everything has been set up
GetTextPeer()->SetStringValue(str);
#endif
-
+
// only now the embedding is correct and we can do a positioning update
MacSuperChangedPosition() ;
if (size.x > 0 && size.y > 0)
return size;
}
-
+
int wText, hText;
// these are the numbers from the HIG:
{
if (CanCopy())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
{
if (CanCut())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
{
if (CanPaste())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
EventsSuppressor noevents(this);
GetTextPeer()->Remove( from , to );
}
-
+
SendTextUpdatedEventIfAllowed();
}
{
if ( !wxNonOwnedWindow::Create(parent, nativeWindow ) )
return false;
-
+
wxTopLevelWindows.Append(this);
-
+
return true;
}
{
if ( m_nowpeer == NULL )
return false;
-
+
return m_nowpeer->IsMaximized();
}
return;
m_nowpeer->ShowWithoutActivating();
-
+
// TODO: Should we call EVT_SIZE here?
}
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
wxCFRef<CFURLRef> curl(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false));
OSStatus err = LSOpenCFURLRef( curl , NULL );
-
+
if (err == noErr)
{
return true;
{
// Make sure there is correct text (instead of unspecified value
// indicator or hint text)
- int flags = property->HasFlag(wxPG_PROP_READONLY) ?
+ int flags = property->HasFlag(wxPG_PROP_READONLY) ?
0 : wxPG_EDITABLE_VALUE;
wxString correctText = property->GetValueAsString(flags);
tc->SetSelection(-1,-1);
}
-
+
void wxPGTextCtrlEditor::OnFocus( wxPGProperty* property,
wxWindow* wnd ) const
{
m_labelEditor->Move(pos.x, r.y + offset);
}
- if ( m_wndEditor || m_wndEditor2 )
+ if ( m_wndEditor || m_wndEditor2 )
{
wxRect r = GetEditorWidgetRect(selected, 1);
//
// Return rect which encloses the given property range
// (in logical grid coordinates)
- //
+ //
int visTop = p1->GetY();
int visBottom;
// Disable splitter auto-centering (but only if moved any -
// otherwise we end up disabling auto-center even after a
// recentering double-click).
- int posDiff = abs(m_startingSplitterX -
+ int posDiff = abs(m_startingSplitterX -
GetSplitterPosition(m_draggedSplitter));
if ( posDiff > 1 )
wxListCtrl* lc = m_elb->GetListCtrl();
int newItemIndex = lc->GetItemCount() - 1;
- if ( m_hasCustomNewAction )
+ if ( m_hasCustomNewAction )
{
wxString str;
if ( OnCustomNewAction(&str) )
dc.SetPen(m_gallery_border_pen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
-
+
DrawGalleryBackgroundCommon(dc, wnd, rect);
}
avail_width -= 8;
if(is_split_hybrid)
{
- dc.DrawLine(rect.x + avail_width + 1, rect.y,
+ dc.DrawLine(rect.x + avail_width + 1, rect.y,
rect.x + avail_width + 1, rect.y + rect.height);
}
dc.DrawBitmap(m_toolbar_drop_bitmap, bg_rect.x + avail_width + 2,
hue += 120.0;
}
else // Max == blue
- {
+ {
hue = 60.0 * (red - green) / (Max - Min);
hue += 240.0;
}
m_tab_ctrl_background_brush = LikePrimary(1.0, 0.39, 0.07);
m_tab_hover_background_colour = LikePrimary(1.3, 0.15, 0.10);
m_tab_hover_background_top_colour = LikePrimary(1.4, 0.36, 0.08);
- m_tab_border_pen = LikePrimary(1.4, 0.03, -0.05);
+ m_tab_border_pen = LikePrimary(1.4, 0.03, -0.05);
m_tab_separator_gradient_colour = LikePrimary(1.7, -0.15, -0.18);
- m_tab_hover_background_top_gradient_colour = LikePrimary(1.8, 0.34, 0.13);
+ m_tab_hover_background_top_gradient_colour = LikePrimary(1.8, 0.34, 0.13);
m_tab_label_colour = LikePrimary(4.3, 0.13, -0.49);
m_tab_hover_background_gradient_colour = LikeSecondary(-1.5, -0.34, 0.01);
m_panel_minimised_label_colour = m_tab_label_colour;
m_gallery_button_disabled_background_colour = LikePrimary(-2.8, -0.46, 0.09);
- m_gallery_button_disabled_background_top_brush = LikePrimary(-2.8, -0.36, 0.15);
+ m_gallery_button_disabled_background_top_brush = LikePrimary(-2.8, -0.36, 0.15);
m_gallery_hover_background_brush = LikePrimary(-0.8, 0.05, 0.15);
m_gallery_border_pen = LikePrimary(0.7, -0.02, 0.03);
m_gallery_button_background_top_brush = LikePrimary(0.8, 0.34, 0.13);
m_gallery_button_active_background_colour = LikeSecondary(-9.9, 0.03, -0.22);
m_gallery_button_active_background_gradient_colour = LikeSecondary(-9.5, 0.14, -0.11);
m_gallery_button_active_background_top_brush = LikeSecondary(-9.0, 0.15, -0.08);
-
+
m_button_bar_label_colour = m_tab_label_colour;
m_button_bar_hover_border_pen = LikeSecondary(-6.2, -0.47, -0.14);
m_button_bar_hover_background_gradient_colour = LikeSecondary(-0.6, 0.16, 0.04);
copy->m_button_bar_active_background_top_colour = m_button_bar_active_background_top_colour;
copy->m_button_bar_active_background_top_gradient_colour = m_button_bar_active_background_top_gradient_colour;
copy->m_gallery_button_background_colour = m_gallery_button_background_colour;
- copy->m_gallery_button_background_gradient_colour = m_gallery_button_background_gradient_colour;
+ copy->m_gallery_button_background_gradient_colour = m_gallery_button_background_gradient_colour;
copy->m_gallery_button_hover_background_colour = m_gallery_button_hover_background_colour;
copy->m_gallery_button_hover_background_gradient_colour = m_gallery_button_hover_background_gradient_colour;
copy->m_gallery_button_active_background_colour = m_gallery_button_active_background_colour;
client_rect.width -= 2;
client_rect.y++;
client_rect.height = (rect.y + rect.height / 5) - client_rect.x;
- dc.GradientFillLinear(client_rect,
+ dc.GradientFillLinear(client_rect,
m_panel_active_background_top_colour,
m_panel_active_background_top_gradient_colour, wxSOUTH);
client_rect.y += client_rect.height;
client_rect.height = (true_rect.y + true_rect.height) - client_rect.y;
- dc.GradientFillLinear(client_rect,
+ dc.GradientFillLinear(client_rect,
m_panel_active_background_colour,
m_panel_active_background_gradient_colour, wxSOUTH);
}
dc.SetTextForeground(m_panel_minimised_label_colour);
dc.DrawText(wnd->GetLabel(), xpos, ypos);
-
+
wxPoint arrow_points[3];
if(m_flags & wxRIBBON_BAR_FLOW_VERTICAL)
dc.DrawText(label_bottom, iX, ypos);
if(arrow_width != 0)
{
- DrawDropdownArrow(dc,
+ DrawDropdownArrow(dc,
iX + 2 +label_w - arrow_width,
ypos + label_h / 2 + 1,
m_button_bar_label_colour);
dc.SetBrush(B);
dc.DrawRectangle(nonrect.x, nonrect.y, nonrect.width, nonrect.height);
}
-
+
// Border
dc.SetPen(m_toolbar_border_pen);
if(state & wxRIBBON_TOOLBAR_TOOL_FIRST)
dc.DrawPoint(rect.x + 1, rect.y + rect.height - 2);
}
else
- dc.DrawLine(rect.x, rect.y + 1, rect.x, rect.y + rect.height - 1);
+ dc.DrawLine(rect.x, rect.y + 1, rect.x, rect.y + rect.height - 1);
if(state & wxRIBBON_TOOLBAR_TOOL_LAST)
{
avail_width -= 8;
if(is_split_hybrid)
{
- dc.DrawLine(rect.x + avail_width + 1, rect.y,
+ dc.DrawLine(rect.x + avail_width + 1, rect.y,
rect.x + avail_width + 1, rect.y + rect.height);
}
dc.DrawBitmap(m_toolbar_drop_bitmap, bg_rect.x + avail_width + 2,
scroll_down.y = scroll_up.y;
scroll_down.height = scroll_up.height;
scroll_down.x = scroll_up.x + scroll_up.width;
- scroll_down.width = scroll_up.width;
+ scroll_down.width = scroll_up.width;
extension.y = scroll_down.y;
extension.height = scroll_down.height;
extension.x = scroll_down.x + scroll_down.width;
scroll_down.x = scroll_up.x;
scroll_down.width = scroll_up.width;
scroll_down.y = scroll_up.y + scroll_up.height;
- scroll_down.height = scroll_up.height;
+ scroll_down.height = scroll_up.height;
extension.x = scroll_down.x;
extension.width = scroll_down.width;
extension.y = scroll_down.y + scroll_down.height;
size.DecBy(16, 1);
size.DecBy( 2, 1);
}
-
+
if(client_offset != NULL)
*client_offset = wxPoint(2, 1);
if(scroll_up_button != NULL)
return AddButton(button_id, label, bitmap, help_string,
wxRIBBON_BUTTON_HYBRID);
}
-
+
wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddButton(
int button_id,
const wxString& label,
bitmap_small = &base->bitmap_small_disabled;
}
wxRect rect(button.position + m_layout_offset, base->sizes[button.size].size);
-
+
m_art->DrawButtonBarButton(dc, this, rect, base->kind,
base->state | button.size, base->label, *bitmap, *bitmap_small);
}
Refresh();
}
-
+
wxRibbonControl::DoSetSize(x, y, width, height, sizeFlags);
}
return false;
return (at_size.GetX() <= m_minimised_size.GetX() &&
- at_size.GetY() <= m_minimised_size.GetY()) ||
+ at_size.GetY() <= m_minimised_size.GetY()) ||
at_size.GetX() < m_smallest_unminimised_size.GetX() ||
at_size.GetY() < m_smallest_unminimised_size.GetY();
}
what = wxRIBBON_TOOLBAR_TOOL_DROPDOWN_HOVERED;
new_hover->state |= what;
-
+
if(new_hover == m_active_tool)
{
new_hover->state &= ~wxRIBBON_TOOLBAR_TOOL_ACTIVE_MASK;
static int SearchAdjacentRect(const wxRichTextFloatRectMapArray& array, int point);
static int GetWidthFromFloatRect(const wxRichTextFloatRectMapArray& array, int index, int startY, int endY);
-
+
static void FreeFloatRectMapArray(wxRichTextFloatRectMapArray& array);
static void DrawFloat(const wxRichTextFloatRectMapArray& array, wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style);
static int HitTestFloat(const wxRichTextFloatRectMapArray& array, wxDC& WXUNUSED(dc), const wxPoint& pt, long& textPosition);
-
+
private:
wxRichTextFloatRectMapArray m_left;
wxRichTextFloatRectMapArray m_right;
while (node)
{
wxRichTextObject* floating = node->GetData();
-
+
if (floating->IsFloating())
{
wxRichTextAnchoredObject* anchor = wxDynamicCast(floating, wxRichTextAnchoredObject);
CollectFloat(para, floating);
}
}
-
+
node = node->GetNext();
}
else
return wxRICHTEXT_HITTEST_AFTER;
}
-
+
return wxRICHTEXT_HITTEST_NONE;
}
return ret;
}
-// Helpers for efficiency
+// Helpers for efficiency
inline void wxCheckSetFont(wxDC& dc, const wxFont& font)
{
// JACS: did I do this some time ago when testing? Should we re-enable it?
m_unitsW = wxRICHTEXT_PX;
m_unitsH = wxRICHTEXT_PX;
-
+
// Unspecified to begin with (use actual image size)
m_width = -1;
m_height = -1;
m_floatCollector->CollectFloat(child);
node = node->GetNext();
}
-
+
return true;
}
int ret = wxRICHTEXT_HITTEST_NONE;
if (m_floatCollector)
ret = m_floatCollector->HitTest(dc, pt, textPosition);
-
+
if (ret == wxRICHTEXT_HITTEST_NONE)
return wxRichTextCompositeObject::HitTest(dc, pt, textPosition);
else
anchored->GetRangeSize(anchored->GetRange(), size, descent, dc, style);
wxRichTextAnchoredObjectAttr attr = anchored->GetAnchoredAttr();
int pos = floatCollector->GetFitPosition(attr.m_floating, rect.y + attr.m_offset, size.y);
-
+
/* Update the offset */
attr.m_offset = pos - rect.y;
anchored->SetAnchoredAttr(attr);
{
if (!m_imageBlock.IsOk())
return false;
-
+
wxImage image;
m_imageBlock.Load(image);
if (!image.IsOk())
return false;
-
+
int width = image.GetWidth();
int height = image.GetHeight();
-
+
if (m_anchoredAttr.m_width != -1)
{
// Calculate the user specified length
{
width = ConvertTenthsMMToPixels(dc, m_anchoredAttr.m_width);
}
- else
+ else
{
width = m_anchoredAttr.m_width;
}
m_imageCache = wxBitmap(img);
}
}
-
+
return m_imageCache.IsOk();
}
// wxSize size = GetCachedSize();
if (!LoadImageCache(dc))
return false;
-
+
int y = rect.y + (rect.height - m_imageCache.GetHeight());
dc.DrawBitmap(m_imageCache, rect.x, y, true);
partialExtents->Add(0);
return false;
}
-
+
int width = m_imageCache.GetWidth();
int height = m_imageCache.GetHeight();
{
if (imageType == wxBITMAP_TYPE_INVALID)
return false; // Could not determine image type
-
+
return DoMakeImageBlock(image, imageType);
}
{
return false;
}
-
+
unsigned char* block = new unsigned char[memStream.GetSize()];
if (!block)
return NULL;
-
+
if (m_data)
delete[] m_data;
m_data = block;
-
- m_imageType = imageType;
+
+ m_imageType = imageType;
m_dataSize = memStream.GetSize();
memStream.CopyTo(m_data, m_dataSize);
void wxRichTextCtrl::OnImage(wxCommandEvent& WXUNUSED(event))
{
if (GetCurrentObject() && GetCurrentObject()->CanEditProperties())
- GetCurrentObject()->EditProperties(this, & GetBuffer());
+ GetCurrentObject()->EditProperties(this, & GetBuffer());
SetCurrentObject(NULL);
}
/////////////////////////////////////////////////////////////////////////////
// Name: src/richtext/richtextimagedlg.cpp
-// Purpose:
+// Purpose:
// Author: Mingquan Yang
-// Modified by:
+// Modified by:
// Created: Wed 02 Jun 2010 11:27:23 CST
-// RCS-ID:
+// RCS-ID:
// Copyright: (c) Mingquan Yang
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
void wxRichTextImageDialog::CreateControls()
-{
+{
#ifdef __WXMAC__
SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#endif
{
m_attr.m_width = image->GetImageCache().GetWidth();
wxASSERT(m_attr.m_unitsW == wxRICHTEXT_PX);
-
+
m_attr.m_unitsW = wxRICHTEXT_PX;
}
if (m_attr.m_height == -1)
{
m_attr.m_height = image->GetImageCache().GetHeight();
wxASSERT(m_attr.m_unitsH == wxRICHTEXT_PX);
-
+
m_attr.m_unitsH = wxRICHTEXT_PX;
}
}
{
if (m_baseStyle.IsEmpty())
return m_style;
-
+
// Collect the styles, detecting loops
wxArrayString styleNames;
wxList styles;
{
styles.Insert((wxObject*) def);
styleNames.Add(def->GetName());
-
+
wxString baseStyleName = def->GetBaseStyle();
if (!baseStyleName.IsEmpty() && styleNames.Index(baseStyleName) == wxNOT_FOUND)
def = sheet->FindStyle(baseStyleName);
else
def = NULL;
}
-
+
wxRichTextAttr attr;
wxList::compatibility_iterator node = styles.GetFirst();
while (node)
attr.Apply(def->GetStyle(), NULL);
node = node->GetNext();
}
-
+
return attr;
}
{
OutputIndentation(stream, indent);
OutputString(stream, wxT("<") + objectName, convMem, convFile);
-
+
OutputString(stream, style + wxT(">"), convMem, convFile);
-
+
if (!fragment.empty() && (fragment[0] == wxT(' ') || fragment[fragment.length()-1] == wxT(' ')))
{
OutputString(stream, wxT("\""), convMem, convFile);
}
else
OutputStringEnt(stream, fragment, convMem, convFile);
-
+
OutputString(stream, wxT("</text>"), convMem, convFile);
}
}
dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize);
return;
#else
-
+
#ifdef wxHAS_RAW_BITMAP
// TODO: do something with cornerSize
buff[len] = 0;
SendMsg(2049, markerNumber, (sptr_t)buff);
delete [] buff;
-
+
}
// Add a set of markers to a line.
buff[len] = 0;
SendMsg(2405, type, (sptr_t)buff);
delete [] buff;
-
+
}
// Clear all the registered images.
}
//else: can't wait for detached threads
}
-
+
if (state == STATE_NEW)
return wxTHREAD_MISC_ERROR;
- // for coherency with the MSW implementation, signal the user that
+ // for coherency with the MSW implementation, signal the user that
// Delete() was called on a thread which didn't start to run yet.
return wxTHREAD_NO_ERROR;
if ( menu )
tool->SetDropdownMenu(menu);
#endif
-
+
return m_toolbar; // must return non-NULL
}