Commit 96b3209a authored by Davis King's avatar Davis King

Organized the Unicode overloads into a more readable format. Also added some missing

overloads to the spec file.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402486
parent 3292376c
...@@ -897,6 +897,8 @@ namespace dlib ...@@ -897,6 +897,8 @@ namespace dlib
same but its width and height are modified same but its width and height are modified
!*/ !*/
void set_text (const std::wstring& str);
void set_text (const dlib::ustring& str);
void set_text ( void set_text (
const std::string& str const std::string& str
); );
...@@ -907,32 +909,9 @@ namespace dlib ...@@ -907,32 +909,9 @@ namespace dlib
will display on the screen when the user hovers the mouse over it will display on the screen when the user hovers the mouse over it
!*/ !*/
// overloads for wide character strings const std::wstring wtext () const;
void set_text ( const dlib::ustring utext () const;
const std::wstring& str const std::string text (
);
void set_text (
const dlib::ustring& str
);
const std::string text (
) const;
/*!
ensures
- returns the text that is displayed inside this
tooltip
!*/
const std::wstring wtext (
) const;
/*!
ensures
- returns the text that is displayed inside this
tooltip
!*/
const dlib::ustring utext (
) const; ) const;
/*! /*!
ensures ensures
......
...@@ -194,6 +194,8 @@ namespace dlib ...@@ -194,6 +194,8 @@ namespace dlib
- all resources associated with *this have been released - all resources associated with *this have been released
!*/ !*/
void set_text (const std::wstring& text);
void set_text (const dlib::ustring& text);
void set_text ( void set_text (
const std::string& text const std::string& text
); );
...@@ -204,45 +206,9 @@ namespace dlib ...@@ -204,45 +206,9 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_text ( const std::wstring wtext () const;
const std::wstring& text const dlib::ustring utext () const;
); const std::string text (
/*!
ensures
- #text() == text
throws
- std::bad_alloc
!*/
void set_text (
const dlib::ustring& text
);
/*!
ensures
- #text() == text
throws
- std::bad_alloc
!*/
const std::string text (
) const;
/*!
ensures
- returns the text of this label
throws
- std::bad_alloc
!*/
const std::wstring wtext (
) const;
/*!
ensures
- returns the text of this label
throws
- std::bad_alloc
!*/
const dlib::ustring utext (
) const; ) const;
/*! /*!
ensures ensures
...@@ -329,6 +295,8 @@ namespace dlib ...@@ -329,6 +295,8 @@ namespace dlib
same but its width and height are modified same but its width and height are modified
!*/ !*/
void set_name (const std::wstring& name);
void set_name (const dlib::ustring& name);
void set_name ( void set_name (
const std::string& name const std::string& name
); );
...@@ -341,49 +309,9 @@ namespace dlib ...@@ -341,49 +309,9 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_name ( const std::wstring wname () const;
const std::wstring& name const dlib::string uname () const;
); const std::string name (
/*!
ensures
- #name() == name
- this button has been resized such that it is big enough to contain
the new name.
throws
- std::bad_alloc
!*/
void set_name (
const dlib::ustring& name
);
/*!
ensures
- #name() == name
- this button has been resized such that it is big enough to contain
the new name.
throws
- std::bad_alloc
!*/
const std::string name (
) const;
/*!
ensures
- returns the name of this button
throws
- std::bad_alloc
!*/
const std::wstring wname (
) const;
/*!
ensures
- returns the name of this button
throws
- std::bad_alloc
!*/
const dlib::string uname (
) const; ) const;
/*! /*!
ensures ensures
...@@ -392,6 +320,8 @@ namespace dlib ...@@ -392,6 +320,8 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_tooltip_text (const std::wstring& text);
void set_tooltip_text (const dlib::ustring& text);
void set_tooltip_text ( void set_tooltip_text (
const std::string& text const std::string& text
); );
...@@ -401,21 +331,9 @@ namespace dlib ...@@ -401,21 +331,9 @@ namespace dlib
- enables the tooltip for this button - enables the tooltip for this button
!*/ !*/
const std::string tooltip_text ( const dlib::ustring tooltip_utext () const;
) const; const std::wstring tooltip_wtext () const;
/*! const std::string tooltip_text (
ensures
- returns the text that is displayed in the tooltip for this button
!*/
const std::wstring tooltip_wtext (
) const;
/*!
ensures
- returns the text that is displayed in the tooltip for this button
!*/
const dlib::ustring tooltip_utext (
) const; ) const;
/*! /*!
ensures ensures
...@@ -527,6 +445,8 @@ namespace dlib ...@@ -527,6 +445,8 @@ namespace dlib
- all resources associated with *this have been released - all resources associated with *this have been released
!*/ !*/
void set_name (const std::wstring& name);
void set_name (const dlib::ustring& name);
void set_name ( void set_name (
const std::string& name const std::string& name
); );
...@@ -539,30 +459,6 @@ namespace dlib ...@@ -539,30 +459,6 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_name (
const std::wstring& name
);
/*!
ensures
- #name() == name
- this toggle_button has been resized such that it is big enough to contain
the new name.
throws
- std::bad_alloc
!*/
void set_name (
const dlib::ustring& name
);
/*!
ensures
- #name() == name
- this toggle_button has been resized such that it is big enough to contain
the new name.
throws
- std::bad_alloc
!*/
void set_size ( void set_size (
unsigned long width_, unsigned long width_,
unsigned long height_ unsigned long height_
...@@ -578,6 +474,8 @@ namespace dlib ...@@ -578,6 +474,8 @@ namespace dlib
same but its width and height are modified same but its width and height are modified
!*/ !*/
void set_tooltip_text (const std::wstring& text);
void set_tooltip_text (const dlib::ustring& text);
void set_tooltip_text ( void set_tooltip_text (
const std::string& text const std::string& text
); );
...@@ -587,25 +485,9 @@ namespace dlib ...@@ -587,25 +485,9 @@ namespace dlib
- enables the tooltip for this toggle_button - enables the tooltip for this toggle_button
!*/ !*/
void set_tooltip_text ( const dlib::ustring tooltip_utext () const;
const std::wstring& text const std::wstring tooltip_wtext () const;
); const std::string tooltip_text (
/*!
ensures
- #tooltip_text() == text
- enables the tooltip for this toggle_button
!*/
void set_tooltip_text (
const dlib::ustring& text
);
/*!
ensures
- #tooltip_text() == text
- enables the tooltip for this toggle_button
!*/
const std::string tooltip_text (
) const; ) const;
/*! /*!
ensures ensures
...@@ -636,27 +518,9 @@ namespace dlib ...@@ -636,27 +518,9 @@ namespace dlib
- returns false - returns false
!*/ !*/
const std::string name ( const std::wstring wname () const;
) const; const dlib::ustring uname () const;
/*! const std::string name (
ensures
- returns the name of this toggle_button. The name is a string
that appears to the right of the actual check box.
throws
- std::bad_alloc
!*/
const std::wstring wname (
) const;
/*!
ensures
- returns the name of this toggle_button. The name is a string
that appears to the right of the actual check box.
throws
- std::bad_alloc
!*/
const dlib::ustring uname (
) const; ) const;
/*! /*!
ensures ensures
...@@ -771,6 +635,8 @@ namespace dlib ...@@ -771,6 +635,8 @@ namespace dlib
- all resources associated with *this have been released - all resources associated with *this have been released
!*/ !*/
void set_text (const std::wstring& text);
void set_text (const dlib::ustring& text);
void set_text ( void set_text (
const std::string& text const std::string& text
); );
...@@ -784,51 +650,9 @@ namespace dlib ...@@ -784,51 +650,9 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_text ( const std::wstring wtext () const;
const std::wstring& text const dlib::ustring utext () const;
); const std::string text (
/*!
requires
- text.find_first_of('\n') == std::wstring::npos
(i.e. there aren't any new lines in text)
ensures
- #text() == text
throws
- std::bad_alloc
!*/
void set_text (
const dlib::ustring& text
);
/*!
requires
- text.find_first_of('\n') == dlib::ustring::npos
(i.e. there aren't any new lines in text)
ensures
- #text() == text
throws
- std::bad_alloc
!*/
const std::string text (
) const;
/*!
ensures
- returns the text of this text_field
throws
- std::bad_alloc
!*/
const std::wstring wtext (
) const;
/*!
ensures
- returns the text of this text_field
throws
- std::bad_alloc
!*/
const dlib::ustring utext (
) const; ) const;
/*! /*!
ensures ensures
...@@ -1061,27 +885,9 @@ namespace dlib ...@@ -1061,27 +885,9 @@ namespace dlib
- returns the number of tabs in this tabbed_display - returns the number of tabs in this tabbed_display
!*/ !*/
const std::string& tab_name ( const std::wstring& tab_wname (unsigned long idx) const;
unsigned long idx const dlib::ustring& tab_uname (unsigned long idx) const;
) const; const std::string& tab_name (
/*!
requires
- idx < number_of_tabs()
ensures
- returns a const reference to the name of the tab given by idx
!*/
const std::wstring& tab_wname (
unsigned long idx
) const;
/*!
requires
- idx < number_of_tabs()
ensures
- returns a const reference to the name of the tab given by idx
!*/
const dlib::ustring& tab_uname (
unsigned long idx unsigned long idx
) const; ) const;
/*! /*!
...@@ -1091,6 +897,8 @@ namespace dlib ...@@ -1091,6 +897,8 @@ namespace dlib
- returns a const reference to the name of the tab given by idx - returns a const reference to the name of the tab given by idx
!*/ !*/
void set_tab_name (unsigned long idx, const std::wstring& new_name);
void set_tab_name (unsigned long idx, const dlib::ustring& new_name);
void set_tab_name ( void set_tab_name (
unsigned long idx, unsigned long idx,
const std::string& new_name const std::string& new_name
...@@ -1104,32 +912,6 @@ namespace dlib ...@@ -1104,32 +912,6 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_tab_name (
unsigned long idx,
const std::wstring& new_name
);
/*!
requires
- idx < number_of_tabs()
ensures
- #tab_name(idx) == new_name
throws
- std::bad_alloc
!*/
void set_tab_name (
unsigned long idx,
const dlib::ustring& new_name
);
/*!
requires
- idx < number_of_tabs()
ensures
- #tab_name(idx) == new_name
throws
- std::bad_alloc
!*/
void set_tab_group ( void set_tab_group (
unsigned long idx, unsigned long idx,
widget_group& group widget_group& group
...@@ -1251,6 +1033,8 @@ namespace dlib ...@@ -1251,6 +1033,8 @@ namespace dlib
around the given rectangle. around the given rectangle.
!*/ !*/
void set_name (const std::wstring& name);
void set_name (const dlib::ustring& name);
void set_name ( void set_name (
const std::string& name const std::string& name
); );
...@@ -1261,45 +1045,9 @@ namespace dlib ...@@ -1261,45 +1045,9 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
void set_name ( const std::wstring wname () const;
const std::wstring& name const dlib::ustring uname () const;
); const std::string name (
/*!
ensures
- #name() == name
throws
- std::bad_alloc
!*/
void set_name (
const dlib::ustring& name
);
/*!
ensures
- #name() == name
throws
- std::bad_alloc
!*/
const std::string name (
) const;
/*!
ensures
- returns the name of this named_rectangle
throws
- std::bad_alloc
!*/
const std::wstring wname (
) const;
/*!
ensures
- returns the name of this named_rectangle
throws
- std::bad_alloc
!*/
const dlib::ustring uname (
) const; ) const;
/*! /*!
ensures ensures
...@@ -1646,6 +1394,8 @@ namespace dlib ...@@ -1646,6 +1394,8 @@ namespace dlib
- returns the number of menus in this menu_bar - returns the number of menus in this menu_bar
!*/ !*/
void set_menu_name (unsigned long idx, const std::wstring name, char underline_ch = '\0');
void set_menu_name (unsigned long idx, const dlib::ustring name, char underline_ch = '\0');
void set_menu_name ( void set_menu_name (
unsigned long idx, unsigned long idx,
const std::string name, const std::string name,
...@@ -1662,27 +1412,9 @@ namespace dlib ...@@ -1662,27 +1412,9 @@ namespace dlib
by hitting alt+underline_char by hitting alt+underline_char
!*/ !*/
const std::string menu_name ( const std::wstring menu_wname (unsigned long idx) const;
unsigned long idx const dlib::ustring menu_uname (unsigned long idx) const;
) const; const std::string menu_name (
/*!
requires
- idx < number_of_menus()
ensures
- returns the name of the menu with index idx
!*/
const std::wstring menu_wname (
unsigned long idx
) const;
/*!
requires
- idx < number_of_menus()
ensures
- returns the name of the menu with index idx
!*/
const dlib::ustring menu_uname (
unsigned long idx unsigned long idx
) const; ) const;
/*! /*!
...@@ -1835,6 +1567,8 @@ namespace dlib ...@@ -1835,6 +1567,8 @@ namespace dlib
- loads a saved graph from the given input stream. - loads a saved graph from the given input stream.
!*/ !*/
void set_node_label (unsigned long i, const std::wstring& label);
void set_node_label (unsigned long i, const dlib::ustring& label);
void set_node_label ( void set_node_label (
unsigned long i, unsigned long i,
const std::string& label const std::string& label
...@@ -1846,28 +1580,6 @@ namespace dlib ...@@ -1846,28 +1580,6 @@ namespace dlib
- #node_label(i) == label - #node_label(i) == label
!*/ !*/
void set_node_label (
unsigned long i,
const std::wstring& label
);
/*!
requires
- i < number_of_nodes()
ensures
- #node_label(i) == label
!*/
void set_node_label (
unsigned long i,
const dlib::ustring& label
);
/*!
requires
- i < number_of_nodes()
ensures
- #node_label(i) == label
!*/
void set_node_color ( void set_node_color (
unsigned long i, unsigned long i,
rgb_pixel color rgb_pixel color
...@@ -1889,27 +1601,9 @@ namespace dlib ...@@ -1889,27 +1601,9 @@ namespace dlib
- returns the color used to draw node graph_node(i) - returns the color used to draw node graph_node(i)
!*/ !*/
const std::string node_label ( const std::wstring node_wlabel (unsigned long i) const;
unsigned long i const dlib::ustring node_ulabel (unsigned long i) const;
) const; const std::string node_label (
/*!
requires
- i < number_of_nodes()
ensures
- returns the text label for node graph_node(i)
!*/
const std::wstring node_wlabel (
unsigned long i
) const;
/*!
requires
- i < number_of_nodes()
ensures
- returns the text label for node graph_node(i)
!*/
const dlib::ustring node_ulabel (
unsigned long i unsigned long i
) const; ) const;
/*! /*!
...@@ -2095,31 +1789,9 @@ namespace dlib ...@@ -2095,31 +1789,9 @@ namespace dlib
- #border_color() == color - #border_color() == color
!*/ !*/
const std::string text ( const std::wstring wtext (unsigned long row, unsigned long col) const;
unsigned long row, const dlib::ustring utext (unsigned long row, unsigned long col) const;
unsigned long col const std::string text (
) const;
/*!
requires
- row < number_of_rows()
- col < number_of_columns()
ensures
- returns the text in the given grid location
!*/
const std::wstring wtext (
unsigned long row,
unsigned long col
) const;
/*!
requires
- row < number_of_rows()
- col < number_of_columns()
ensures
- returns the text in the given grid location
!*/
const dlib::ustring utext (
unsigned long row, unsigned long row,
unsigned long col unsigned long col
) const; ) const;
...@@ -2131,6 +1803,8 @@ namespace dlib ...@@ -2131,6 +1803,8 @@ namespace dlib
- returns the text in the given grid location - returns the text in the given grid location
!*/ !*/
void set_text (unsigned long row, unsigned long col, const std::wstring& str);
void set_text (unsigned long row, unsigned long col, const dlib::ustring& str);
void set_text ( void set_text (
unsigned long row, unsigned long row,
unsigned long col, unsigned long col,
...@@ -2144,32 +1818,6 @@ namespace dlib ...@@ -2144,32 +1818,6 @@ namespace dlib
- #text(row,col) == str - #text(row,col) == str
!*/ !*/
void set_text (
unsigned long row,
unsigned long col,
const std::wstring& str
);
/*!
requires
- row < number_of_rows()
- col < number_of_columns()
ensures
- #text(row,col) == str
!*/
void set_text (
unsigned long row,
unsigned long col,
const dlib::ustring& str
);
/*!
requires
- row < number_of_rows()
- col < number_of_columns()
ensures
- #text(row,col) == str
!*/
const rgb_pixel text_color ( const rgb_pixel text_color (
unsigned long row, unsigned long row,
unsigned long col unsigned long col
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment