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,15 +909,8 @@ namespace dlib ...@@ -907,15 +909,8 @@ 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
);
void set_text (
const dlib::ustring& str
);
const std::string text ( const std::string text (
) const; ) const;
/*! /*!
...@@ -924,22 +919,6 @@ namespace dlib ...@@ -924,22 +919,6 @@ namespace dlib
tooltip tooltip
!*/ !*/
const std::wstring wtext (
) const;
/*!
ensures
- returns the text that is displayed inside this
tooltip
!*/
const dlib::ustring utext (
) const;
/*!
ensures
- returns the text that is displayed inside this
tooltip
!*/
private: private:
// restricted functions // restricted functions
......
...@@ -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,26 +206,8 @@ namespace dlib ...@@ -204,26 +206,8 @@ 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;
);
/*!
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 std::string text (
) const; ) const;
/*! /*!
...@@ -233,24 +217,6 @@ namespace dlib ...@@ -233,24 +217,6 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
const std::wstring wtext (
) const;
/*!
ensures
- returns the text of this label
throws
- std::bad_alloc
!*/
const dlib::ustring utext (
) const;
/*!
ensures
- returns the text of this label
throws
- std::bad_alloc
!*/
void set_text_color ( void set_text_color (
const rgb_pixel color const rgb_pixel color
); );
...@@ -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,30 +309,8 @@ namespace dlib ...@@ -341,30 +309,8 @@ 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;
);
/*!
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 std::string name (
) const; ) const;
/*! /*!
...@@ -374,24 +320,8 @@ namespace dlib ...@@ -374,24 +320,8 @@ namespace dlib
- std::bad_alloc - std::bad_alloc
!*/ !*/
const std::wstring wname ( void set_tooltip_text (const std::wstring& text);
) const; void set_tooltip_text (const dlib::ustring& text);
/*!
ensures
- returns the name of this button
throws
- std::bad_alloc
!*/
const dlib::string uname (
) const;
/*!
ensures
- returns the name of this button
throws
- std::bad_alloc
!*/
void set_tooltip_text ( void set_tooltip_text (
const std::string& text const std::string& text
); );
...@@ -401,6 +331,8 @@ namespace dlib ...@@ -401,6 +331,8 @@ namespace dlib
- enables the tooltip for this button - enables the tooltip for this button
!*/ !*/
const dlib::ustring tooltip_utext () const;
const std::wstring tooltip_wtext () const;
const std::string tooltip_text ( const std::string tooltip_text (
) const; ) const;
/*! /*!
...@@ -408,20 +340,6 @@ namespace dlib ...@@ -408,20 +340,6 @@ namespace dlib
- returns the text that is displayed in the tooltip for this button - 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;
/*!
ensures
- returns the text that is displayed in the tooltip for this button
!*/
template < template <
typename style_type typename style_type
> >
...@@ -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,24 +485,8 @@ namespace dlib ...@@ -587,24 +485,8 @@ 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;
);
/*!
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 std::string tooltip_text (
) const; ) const;
/*! /*!
...@@ -636,6 +518,8 @@ namespace dlib ...@@ -636,6 +518,8 @@ namespace dlib
- returns false - returns false
!*/ !*/
const std::wstring wname () const;
const dlib::ustring uname () const;
const std::string name ( const std::string name (
) const; ) const;
/*! /*!
...@@ -646,26 +530,6 @@ namespace dlib ...@@ -646,26 +530,6 @@ namespace dlib
- std::bad_alloc - 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;
/*!
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
!*/
void set_checked ( void set_checked (
); );
/*! /*!
...@@ -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,32 +650,8 @@ namespace dlib ...@@ -784,32 +650,8 @@ 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;
);
/*!
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 std::string text (
) const; ) const;
/*! /*!
...@@ -819,24 +661,6 @@ namespace dlib ...@@ -819,24 +661,6 @@ namespace dlib
- std::bad_alloc - 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;
/*!
ensures
- returns the text of this text_field
throws
- std::bad_alloc
!*/
void set_width ( void set_width (
unsigned long width_ unsigned long width_
); );
...@@ -1061,6 +885,8 @@ namespace dlib ...@@ -1061,6 +885,8 @@ namespace dlib
- returns the number of tabs in this tabbed_display - returns the number of tabs in this tabbed_display
!*/ !*/
const std::wstring& tab_wname (unsigned long idx) const;
const dlib::ustring& tab_uname (unsigned long idx) const;
const std::string& tab_name ( const std::string& tab_name (
unsigned long idx unsigned long idx
) const; ) const;
...@@ -1071,26 +897,8 @@ namespace dlib ...@@ -1071,26 +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
!*/ !*/
const std::wstring& tab_wname ( void set_tab_name (unsigned long idx, const std::wstring& new_name);
unsigned long idx void set_tab_name (unsigned long idx, const dlib::ustring& new_name);
) 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
) const;
/*!
requires
- idx < number_of_tabs()
ensures
- returns a const reference to the name of the tab given by idx
!*/
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,26 +1045,8 @@ namespace dlib ...@@ -1261,26 +1045,8 @@ 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;
);
/*!
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 std::string name (
) const; ) const;
/*! /*!
...@@ -1290,24 +1056,6 @@ namespace dlib ...@@ -1290,24 +1056,6 @@ namespace dlib
- std::bad_alloc - 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;
/*!
ensures
- returns the name of this named_rectangle
throws
- std::bad_alloc
!*/
private: private:
// restricted functions // restricted functions
...@@ -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,6 +1412,8 @@ namespace dlib ...@@ -1662,6 +1412,8 @@ namespace dlib
by hitting alt+underline_char by hitting alt+underline_char
!*/ !*/
const std::wstring menu_wname (unsigned long idx) const;
const dlib::ustring menu_uname (unsigned long idx) const;
const std::string menu_name ( const std::string menu_name (
unsigned long idx unsigned long idx
) const; ) const;
...@@ -1672,26 +1424,6 @@ namespace dlib ...@@ -1672,26 +1424,6 @@ namespace dlib
- returns the name of the menu with index idx - 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
) const;
/*!
requires
- idx < number_of_menus()
ensures
- returns the name of the menu with index idx
!*/
popup_menu& menu ( popup_menu& menu (
unsigned long idx unsigned long idx
); );
...@@ -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,6 +1601,8 @@ namespace dlib ...@@ -1889,6 +1601,8 @@ namespace dlib
- returns the color used to draw node graph_node(i) - returns the color used to draw node graph_node(i)
!*/ !*/
const std::wstring node_wlabel (unsigned long i) const;
const dlib::ustring node_ulabel (unsigned long i) const;
const std::string node_label ( const std::string node_label (
unsigned long i unsigned long i
) const; ) const;
...@@ -1899,26 +1613,6 @@ namespace dlib ...@@ -1899,26 +1613,6 @@ namespace dlib
- returns the text label for node graph_node(i) - 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
) const;
/*!
requires
- i < number_of_nodes()
ensures
- returns the text label for node graph_node(i)
!*/
template < template <
typename T typename T
> >
...@@ -2095,6 +1789,8 @@ namespace dlib ...@@ -2095,6 +1789,8 @@ namespace dlib
- #border_color() == color - #border_color() == color
!*/ !*/
const std::wstring wtext (unsigned long row, unsigned long col) const;
const dlib::ustring utext (unsigned long row, unsigned long col) const;
const std::string text ( const std::string text (
unsigned long row, unsigned long row,
unsigned long col unsigned long col
...@@ -2107,30 +1803,8 @@ namespace dlib ...@@ -2107,30 +1803,8 @@ namespace dlib
- returns the text in the given grid location - returns the text in the given grid location
!*/ !*/
const std::wstring wtext ( void set_text (unsigned long row, unsigned long col, const std::wstring& str);
unsigned long row, void set_text (unsigned long row, unsigned long col, const dlib::ustring& str);
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 col
) const;
/*!
requires
- row < number_of_rows()
- col < number_of_columns()
ensures
- returns the text in the given grid location
!*/
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