@param size
size of the new buffer.
*/
- wxMemoryBuffer(size_t size);
+ wxMemoryBuffer(size_t size = DefBufSize);
/**
Append a single byte to the buffer.
does have it, this pointer may be used to directly manipulate the alpha values
which are stored as the RGB ones.
*/
- const unsigned char * GetAlpha() const;
+ unsigned char* GetAlpha() const;
/**
Returns the blue intensity at the given coordinate.
@see SaveFile()
*/
- bool LoadFile(wxInputStream& stream, wxBitmapType type, int index = -1);
+ virtual bool LoadFile(wxInputStream& stream,
+ wxBitmapType type = wxBITMAP_TYPE_ANY,
+ int index = -1);
/**
Loads an image from a file.
*/
void SetAlpha(int x, int y, unsigned char alpha);
+ //@{
/**
Sets the image data without performing checks.
that will be responsible for deleting it.
Do not pass to this function a pointer obtained through GetData().
*/
- void SetData(unsigned char* data);
+ void SetData(unsigned char* data, bool static_data = false);
+ void SetData(unsigned char* data, int new_width, int new_height,
+ bool static_data = false);
+ //@}
/**
Specifies whether there is a mask or not.
This routine performs bounds-checks for the coordinate so it can be considered
a safe way to manipulate the data.
*/
- void SetRGB(wxRect& rect, unsigned char red,
+ void SetRGB(const wxRect& rect,
+ unsigned char red,
unsigned char green,
unsigned char blue);
bitmap will automatically be split into smaller images, each
matching the dimensions of the image list.
This does not apply when adding icons.
+
+ @onlyfor{wxmsw,wxmac}
*/
int Add(const wxIcon& icon);
@remarks The original bitmap or icon is not affected by the Replace()
operation, and can be deleted afterwards.
+
+ @onlyfor{wxmsw,wxmac}
*/
bool Replace(int index, const wxIcon& icon);
};
@param id
The button id to report, from 0 to GetNumberButtons() - 1
*/
- bool GetButtonState(unsigned id) const;
+ bool GetButtonState(unsigned int id) const;
/**
Returns the manufacturer id.
@param axis
The joystick axis to report, from 0 to GetNumberAxes() - 1.
*/
- int GetPosition(unsigned axis) const;
+ int GetPosition(unsigned int axis) const;
/**
Returns the product id for the joystick.
By default, no modifiers are active.
*/
- wxKeyboardState(bool controlDown,
- bool shiftDown,
- bool altDown,
- bool metaDown);
+ wxKeyboardState(bool controlDown = false,
+ bool shiftDown = false,
+ bool altDown = false,
+ bool metaDown = false);
/**
Return the bit mask of all pressed modifier keys.
-
+
The return value is a combination of @c wxMOD_ALT, @c wxMOD_CONTROL,
@c wxMOD_SHIFT and @c wxMOD_META bit masks. Additionally, @c wxMOD_NONE
is defined as 0, i.e. corresponds to no modifiers (see HasModifiers())
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxString& name = wxEmptyStr);
+ const wxString& name = wxEmptyString);
/**
Returns the wxListView associated with the control.
Position before which to insert the items: if pos is 0 the
items will be inserted in the beginning of the listbox
*/
- void InsertItems(int nItems, const wxString *items,
+ void InsertItems(unsigned int nItems, const wxString *items,
unsigned int pos);
/**
@param clientData
Options array of client data pointers
*/
- void Set(int n, const wxString* choices, void **clientData = NULL);
+ void Set(unsigned int n, const wxString* choices, void *clientData);
/**
Clears the list box and adds the given strings to it.
@param clientData
Options array of client data pointers
*/
- void Set(const wxArrayString& choices, void **clientData = NULL);
+ void Set(const wxArrayString& choices, void *clientData);
/**
Set the specified item to be the first visible item.
Find an item whose data matches this data, starting from start or the
beginning if 'start' is @c -1.
*/
- long FindItem(long start, long data);
+ long FindItem(long start, wxUIntPtr data);
/**
Find an item nearest this position in the specified direction,
/**
Constructor.
*/
- wxListEvent(wxEventType commandType = 0, int id = 0);
+ wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
/**
For @c EVT_LIST_CACHE_HINT event only: return the first item which the
Construct a wxListItemAttr with the specified foreground and
background colors and font.
*/
- wxListItemAttr(const wxColour colText,
- const wxColour colBack,
- const wxFont font);
+ wxListItemAttr(const wxColour& colText,
+ const wxColour& colBack,
+ const wxFont& font);
/**
Returns the currently set background color.
Constructs a log target which sends all the log messages to the given
output stream. If it is @NULL, the messages are sent to @c cerr.
*/
- wxLogStream(std::ostream ostr = NULL);
+ wxLogStream(std::ostream *ostr = NULL);
};
@param name
Window name.
*/
- wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName = wxT(""),
+ wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = 0, const wxString& szBackend = wxT(""),
+ long style = 0, const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxPanelNameStr);
+ const wxString& name = "mediaCtrl");
/**
Creates this control.
@param name
Window name.
*/
- bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName = wxT(""),
+ bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = 0, const wxString& szBackend = wxT(""),
+ long style = 0, const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxPanelNameStr);
+ const wxString& name = "mediaCtrl");
/**
Obtains the best size relative to the original/natural size of the
@remarks Only use this when the menu bar has been associated with a
frame; otherwise, use the wxMenu equivalent call.
*/
- void Enable(int id, const bool enable);
+ void Enable(int id, bool enable);
/**
Enables or disables a whole menu.
@param style
If set to wxMENU_TEAROFF, the menu will be detachable (wxGTK only).
*/
- wxMenu(const wxString& title = "", long style = 0);
+ wxMenu(const wxString& title, long style = 0);
/**
Destructor, destroying the menu.
@see FindItem(), Destroy(), Remove()
*/
- void Delete(int id);
+ bool Delete(int id);
/**
Deletes the menu item from the menu. If the item is a submenu, it will
@see FindItem(), Destroy(), Remove()
*/
- void Delete(wxMenuItem* item);
+ bool Delete(wxMenuItem* item);
/**
Deletes the menu item from the menu. If the item is a submenu, it will
@see FindItem(), Deletes(), Remove()
*/
- void Destroy(int id);
+ bool Destroy(int id);
/**
Deletes the menu item from the menu. If the item is a submenu, it will
@see FindItem(), Deletes(), Remove()
*/
- void Destroy(wxMenuItem* item);
+ bool Destroy(wxMenuItem* item);
/**
Enables or disables (greys out) a menu item.
@return Menu item object or NULL if none is found.
*/
- const wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const;
+ wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const;
/**
Returns the wxMenuItem given a position in the menu.
*/
size_t GetMenuItemCount() const;
+ //@{
/**
Returns the list of items in the menu.
wxMenuItemList is a pseudo-template list class containing wxMenuItem
pointers, see wxList.
*/
- wxMenuItemList GetMenuItems() const;
+ wxMenuItemList& GetMenuItems() const;
+ const wxMenuItemList& GetMenuItems() const;
+ //@}
/**
Returns the title of the menu.
@see Append(), Prepend()
*/
wxMenuItem* Insert(size_t pos, int id,
- const wxString& item = "",
- const wxString& helpString = "",
+ const wxString& item = wxEmptyString,
+ const wxString& helpString = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL);
/**
@see Append(), Insert()
*/
- wxMenuItem* Prepend(int id, const wxString& item = "",
- const wxString& helpString = "",
+ wxMenuItem* Prepend(int id, const wxString& item = wxEmptyString,
+ const wxString& helpString = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL);
/**
If non-@NULL, indicates that the menu item is a submenu.
*/
wxMenuItem(wxMenu* parentMenu = NULL, int id = wxID_SEPARATOR,
- const wxString& text = "",
- const wxString& helpString = "",
+ const wxString& text = wxEmptyString,
+ const wxString& helpString = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu* subMenu = NULL);
Dialog position (ignored under MSW).
*/
wxMessageDialog(wxWindow* parent, const wxString& message,
- const wxString& caption = "Message box",
+ const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK | wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
buffer data of length len. The stream does not take ownership of the buffer,
i.e. the buffer will not be deleted in its destructor.
*/
- wxMemoryInputStream(const char* data, size_t len);
+ wxMemoryInputStream(const void* data, size_t len);
/**
Creates a new read-only memory stream, initializing it with the data from
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL,
- const wxString& name = "panel");
+ const wxString& name = wxPanelNameStr);
/**
Destructor. Deletes any child windows before deleting the physical window.
@param stipple
A stipple bitmap.
+ @onlyfor{wxmsw,wxmac}
+
@see SetWidth(), SetStipple()
*/
wxPen(const wxBitmap& stipple, int width);
@return @true on success, @false if something goes wrong (invalid @a service).
*/
- bool Service(unsigned short service);
+ bool Service(unsigned short service) = 0;
/**
Returns the current service.
*/
- unsigned short Service();
+ unsigned short Service() const = 0;
};
/**
Returns the current service.
*/
- virtual unsigned short Service();
+ virtual unsigned short Service() const;
};
compatibility concerns).
*/
const wxWCharBuffer cMB2WC(const char* in,
- size_t inLen = wxNO_LEN,
- size_t *outLen = NULL) const;
+ size_t inLen,
+ size_t *outLen) const;
//@{
/**
FromWChar(), please see the description of cMB2WC() for more details.
*/
const wxCharBuffer cWC2MB(const wchar_t* in,
- size_t inLen = wxNO_LEN,
- size_t *outLen = NULL) const;
+ size_t inLen,
+ size_t *outLen) const;
//@{
/**
This function returns a reference on the current object, so the user can
test any states of the stream right away.
*/
- wxOutputStream Write(const void* buffer, size_t size);
+ wxOutputStream& Write(const void* buffer, size_t size);
/**
Reads data from the specified input stream and stores them
in the current stream. The data is read until an error is raised
by one of the two streams.
*/
- wxOutputStream Write(wxInputStream& stream_in);
+ wxOutputStream& Write(wxInputStream& stream_in);
};
@return This function returns a reference on the current object, so the
user can test any states of the stream right away.
*/
- wxInputStream Read(void* buffer, size_t size);
+ virtual wxInputStream& Read(void* buffer, size_t size);
/**
Reads data from the input queue and stores it in the specified output stream.
@return Returns the amount of bytes saved in the Write-Back buffer.
*/
- size_t Ungetch(const char* buffer, size_t size);
+ size_t Ungetch(const void* buffer, size_t size);
/**
This function acts like the previous one except that it takes only one
character: it is sometimes shorter to use than the generic function.
*/
- Return value bool Ungetch(char c);
+ bool Ungetch(char c);
};