Mercurial > hg > openttd
comparison src/misc_gui.cpp @ 7372:694c7b595661 draft
(svn r10736) -Fix: Correct all mispellings of 'successful'.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Mon, 30 Jul 2007 13:36:09 +0000 |
parents | 4772500cfc44 |
children | f9b4e970b14d |
comparison
equal
deleted
inserted
replaced
7371:e03ba4271be4 | 7372:694c7b595661 |
---|---|
857 /** | 857 /** |
858 * Delete a character from a textbuffer, either with 'Delete' or 'Backspace' | 858 * Delete a character from a textbuffer, either with 'Delete' or 'Backspace' |
859 * The character is delete from the position the caret is at | 859 * The character is delete from the position the caret is at |
860 * @param tb Textbuf type to be changed | 860 * @param tb Textbuf type to be changed |
861 * @param delmode Type of deletion, either WKC_BACKSPACE or WKC_DELETE | 861 * @param delmode Type of deletion, either WKC_BACKSPACE or WKC_DELETE |
862 * @return Return true on successfull change of Textbuf, or false otherwise | 862 * @return Return true on successful change of Textbuf, or false otherwise |
863 */ | 863 */ |
864 bool DeleteTextBufferChar(Textbuf *tb, int delmode) | 864 bool DeleteTextBufferChar(Textbuf *tb, int delmode) |
865 { | 865 { |
866 if (delmode == WKC_BACKSPACE && tb->caretpos != 0) { | 866 if (delmode == WKC_BACKSPACE && tb->caretpos != 0) { |
867 DelChar(tb, true); | 867 DelChar(tb, true); |
889 * Insert a character to a textbuffer. If maxwidth of the Textbuf is zero, | 889 * Insert a character to a textbuffer. If maxwidth of the Textbuf is zero, |
890 * we don't care about the visual-length but only about the physical | 890 * we don't care about the visual-length but only about the physical |
891 * length of the string | 891 * length of the string |
892 * @param tb Textbuf type to be changed | 892 * @param tb Textbuf type to be changed |
893 * @param key Character to be inserted | 893 * @param key Character to be inserted |
894 * @return Return true on successfull change of Textbuf, or false otherwise | 894 * @return Return true on successful change of Textbuf, or false otherwise |
895 */ | 895 */ |
896 bool InsertTextBufferChar(Textbuf *tb, WChar key) | 896 bool InsertTextBufferChar(Textbuf *tb, WChar key) |
897 { | 897 { |
898 const byte charwidth = GetCharacterWidth(FS_NORMAL, key); | 898 const byte charwidth = GetCharacterWidth(FS_NORMAL, key); |
899 size_t len = Utf8CharLen(key); | 899 size_t len = Utf8CharLen(key); |
913 /** | 913 /** |
914 * Handle text navigation with arrow keys left/right. | 914 * Handle text navigation with arrow keys left/right. |
915 * This defines where the caret will blink and the next characer interaction will occur | 915 * This defines where the caret will blink and the next characer interaction will occur |
916 * @param tb Textbuf type where navigation occurs | 916 * @param tb Textbuf type where navigation occurs |
917 * @param navmode Direction in which navigation occurs WKC_LEFT, WKC_RIGHT, WKC_END, WKC_HOME | 917 * @param navmode Direction in which navigation occurs WKC_LEFT, WKC_RIGHT, WKC_END, WKC_HOME |
918 * @return Return true on successfull change of Textbuf, or false otherwise | 918 * @return Return true on successful change of Textbuf, or false otherwise |
919 */ | 919 */ |
920 bool MoveTextBufferPos(Textbuf *tb, int navmode) | 920 bool MoveTextBufferPos(Textbuf *tb, int navmode) |
921 { | 921 { |
922 switch (navmode) { | 922 switch (navmode) { |
923 case WKC_LEFT: | 923 case WKC_LEFT: |
1587 if (IsWindowWidgetLowered(w, 11)) { // Delete button clicked | 1587 if (IsWindowWidgetLowered(w, 11)) { // Delete button clicked |
1588 if (!FiosDelete(WP(w, querystr_d).text.buf)) { | 1588 if (!FiosDelete(WP(w, querystr_d).text.buf)) { |
1589 ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0); | 1589 ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0); |
1590 } else { | 1590 } else { |
1591 BuildFileList(); | 1591 BuildFileList(); |
1592 /* Reset file name to current date on successfull delete */ | 1592 /* Reset file name to current date on successful delete */ |
1593 if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName(); | 1593 if (_saveload_mode == SLD_SAVE_GAME) GenerateFileName(); |
1594 } | 1594 } |
1595 | 1595 |
1596 UpdateTextBufferSize(&WP(w, querystr_d).text); | 1596 UpdateTextBufferSize(&WP(w, querystr_d).text); |
1597 SetWindowDirty(w); | 1597 SetWindowDirty(w); |