Browse Source

fixed: in command CopyBoth /WmCommand_EditCopyBoth()/

after opening the clipboard the method EmptyClipboard() ought to be called
fixed:   some compiler warnings
changed: in command: (...) and 1/(...)
         if the input string is empty then the cursor is put between the brackets


git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@249 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 13 years ago
parent
commit
e6b64ccdad
  1. 7
      src/bigtypes.h
  2. 28
      src/languages.cpp
  3. 10
      src/mainwindow.cpp
  4. 2
      src/programresources.h
  5. 1
      src/stopcalculating.h
  6. 8
      src/tabs.cpp

7
src/bigtypes.h

@ -40,9 +40,16 @@
#include "compileconfig.h"
//#define TTMATH_RELEASE
#include <ttmath/ttmath.h>
#ifdef _MSC_VER
//"warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)"
// (ttmath set it to default)
#pragma warning (disable : 4800)
#endif
#ifndef TTCALC_PORTABLE

28
src/languages.cpp

@ -494,7 +494,7 @@ void Languages::InitGuiMessagesTab()
"Contact: t.sowa@ttmath.org\r\n"
"Licence: BSD (open source)\r\n"
"Project page: http://ttcalc.sourceforge.net\r\n"
"Bignum library: TTMath %d.%d.%d%s\r\n"
"Bignum library: TTMath %d.%d.%d%s (%s)\r\n"
"Bignum type: binary floating point numbers\r\n"
"Programming language: C++\r\n"
"Compiler: %s\r\n"
@ -522,7 +522,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " portable version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "About");
InsertGuiPair(about_box_button_close, "Close");
InsertGuiPair(unknown_error, "An unknown error has occurred");
@ -689,7 +689,7 @@ void Languages::InitGuiMessagesTab()
"Kontakt: t.sowa@ttmath.org\r\n"
"Licencja: BSD (open source)\r\n"
"Strona projektu: http://ttcalc.sourceforge.net\r\n"
"Biblioteka du¿ych liczb: TTMath %d.%d.%d%s\r\n"
"Biblioteka du¿ych liczb: TTMath %d.%d.%d%s (%s)\r\n"
"Rodzaj du¿ych liczb: liczby binarne zmiennoprzecinkowe\r\n"
"Jêzyk programowania: C++\r\n"
"Kompilator: %s\r\n"
@ -717,7 +717,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " wersja portable");
InsertGuiPair(about_text_exe_packer, "Paker exe: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "Paker exe: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "O programie");
InsertGuiPair(about_box_button_close, "Zamknij");
InsertGuiPair(unknown_error, "Nieznany kod b³êdu");
@ -888,7 +888,7 @@ void Languages::InitGuiMessagesTab()
"Contacto: t.sowa@ttmath.org\r\n"
"Licencia: BSD (open source)\r\n"
"Página del proyecto: http://ttcalc.sourceforge.net\r\n"
"Biblioteca Bignum: TTMath %d.%d.%d%s\r\n"
"Biblioteca Bignum: TTMath %d.%d.%d%s (%s)\r\n"
"Bignum type: binary floating point numbers\r\n"
"Lenguaje de programación: C++\r\n"
"Compilador: %s\r\n"
@ -916,7 +916,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " versión portatil");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "Acerca de");
InsertGuiPair(about_box_button_close, "Cerrar");
InsertGuiPair(unknown_error, "Ocurrió un error desconocido");
@ -1084,7 +1084,7 @@ void Languages::InitGuiMessagesTab()
"Kontakt: t.sowa@ttmath.org\r\n"
"Licens: BSD (open source)\r\n"
"Projekt side: http://ttcalc.sourceforge.net\r\n"
"Bignum biblotek: TTMath %d.%d.%d%s\r\n"
"Bignum biblotek: TTMath %d.%d.%d%s (%s)\r\n"
"Bignum type: binary floating point numbers\r\n"
"Programmerings sprog: C++\r\n"
"Kompilator: %s\r\n"
@ -1112,7 +1112,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " transportabel version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "Om");
InsertGuiPair(about_box_button_close, "Luk");
InsertGuiPair(unknown_error, "Der er sket en ukendt fejl");
@ -1277,7 +1277,7 @@ void Languages::InitGuiMessagesTab()
"ÁªÏµ: t.sowa@ttmath.org\r\n"
"Ðí¿É: BSD (¿ªÔ´ÏîÄ¿)\r\n"
"Ö÷Ò³: http://ttcalc.sourceforge.net\r\n"
"Bignum library: TTMath %d.%d.%d%s\r\n"
"Bignum library: TTMath %d.%d.%d%s (%s)\r\n"
"Bignum type: binary floating point numbers\r\n"
"Programming language: C++\r\n"
"Compiler: %s\r\n"
@ -1305,7 +1305,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " portable version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "¹ØÓÚ");
InsertGuiPair(about_box_button_close, "¹Ø±Õ");
InsertGuiPair(unknown_error, "·¢Éúδ֪´íÎó");
@ -1474,7 +1474,7 @@ void Languages::InitGuiMessagesTab()
"e-mail: t.sowa@ttmath.org\r\n"
"Ëèöåíçèÿ: BSD (open source)\r\n"
"Ñàéò ïðîåêòà: http://ttcalc.sourceforge.net\r\n"
"Áèáëèîòåêà Bignum: TTMath %d.%d.%d%s\r\n"
"Áèáëèîòåêà Bignum: TTMath %d.%d.%d%s (%s)\r\n"
"Òèï Bignum: Äâîè÷íàÿ ñèñòåìà ñ÷èñëåíèÿ, ÷èñëà ñ ïëàâàþùåé çàïÿòîé\r\n"
"ßçûê ïðîãðàììèðîâàíèÿ: C++\r\n"
"Êîìïèëÿòîð: %s\r\n"
@ -1503,7 +1503,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " ïåðåíîñíàÿ âåðñèÿ");
InsertGuiPair(about_text_exe_packer, "óïàêîâùèê EXE: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "óïàêîâùèê EXE: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "Î ïðîãðàììå");
InsertGuiPair(about_box_button_close, "Çàêðûòü");
InsertGuiPair(unknown_error, "Íåèçâåñòíàÿ îøèáêà");
@ -1671,7 +1671,7 @@ void Languages::InitGuiMessagesTab()
"Kontakt: t.sowa@ttmath.org\r\n"
"Licens: BSD (open source)\r\n"
"Projektsida: http://ttcalc.sourceforge.net\r\n"
"Bignumbiblotek: TTMath %d.%d.%d%s\r\n"
"Bignumbiblotek: TTMath %d.%d.%d%s (%s)\r\n"
"Bignum type: binary floating point numbers\r\n"
"Programmeringsspråk: C++\r\n"
"Kompilator: %s\r\n"
@ -1699,7 +1699,7 @@ void Languages::InitGuiMessagesTab()
" lars.gafvert@gmail.com\r\n"
);
InsertGuiPair(about_text_portable_version, " transportabel version");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.03\r\n");
InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.04\r\n");
InsertGuiPair(about_box_title, "Om");
InsertGuiPair(about_box_button_close, "Bäver");
InsertGuiPair(unknown_error, "Det har inträffat ett okänt fel");

10
src/mainwindow.cpp

@ -40,7 +40,7 @@
#include "winmain.h"
#include "update.h"
#include "pad.h"
#include "bigtypes.h"
namespace MainWindowFunctions
@ -1146,6 +1146,7 @@ BOOL WmCommand_EditCopyBoth(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
if( !OpenClipboard(hWnd) )
return true;
EmptyClipboard();
HGLOBAL global = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, in_len+out_len + 20);
if( global )
@ -1165,7 +1166,7 @@ BOOL WmCommand_EditCopyBoth(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
std::strcat(text, buf);
GlobalUnlock(global);
set_correct = SetClipboardData(CF_TEXT, global);
set_correct = (bool)SetClipboardData(CF_TEXT, global);
}
}
@ -1533,9 +1534,10 @@ char compiler[50];
#else
GetPrgRes()->GetLanguages()->GuiMessage(Languages::about_text_portable_version),
#endif
(TTCALC_PRERELEASE_VER!=0)? " (prerelease)" : "",
(TTCALC_PRERELEASE_VER!=0)? " prerelease" : "",
TTMATH_MAJOR_VER, TTMATH_MINOR_VER, TTMATH_REVISION_VER,
(TTMATH_PRERELEASE_VER!=0)? " (prerelease)" : "",
(TTMATH_PRERELEASE_VER!=0)? " prerelease" : "",
TTMathBigMax::LibTypeStr(),
compiler,
#ifndef TTCALC_PORTABLE
""

2
src/programresources.h

@ -508,7 +508,7 @@ private:
int pad_y_pos;
int pad_x_size;
int pad_y_size;
int pad_maximized;
bool pad_maximized;
int base_input;
int base_output;

1
src/stopcalculating.h

@ -46,6 +46,7 @@
#include "compileconfig.h"
#include <ttmath/ttmathtypes.h>
#include <windows.h>
#include <cstdio>
/*!

8
src/tabs.cpp

@ -1119,6 +1119,10 @@ BOOL WmTabCommand_Press_bracketsall(HWND hWnd, UINT message, WPARAM wParam, LPAR
SendMessage(input, EM_SETSEL, end+1, end+1);
SendMessage(input, EM_REPLACESEL, 1, LPARAM(")"));
if( start == end )
// was empty string - we're setting the cursor inside the brackets
SendMessage(input, EM_SETSEL, end+1, end+1);
SetFocus(input);
return true;
@ -1139,6 +1143,10 @@ BOOL WmTabCommand_Press_1div_bracketsall(HWND hWnd, UINT message, WPARAM wParam,
SendMessage(input, EM_SETSEL, end+3, end+3);
SendMessage(input, EM_REPLACESEL, 1, LPARAM(")"));
if( start == end )
// was empty string - we're setting the cursor inside the brackets
SendMessage(input, EM_SETSEL, end+3, end+3);
SetFocus(input);
return true;

Loading…
Cancel
Save