diff --git a/CHANGELOG b/CHANGELOG index 4cf90a1..a6b51d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,10 @@ Version 0.9.0 prerelease (2009.09.15): + * added: Pad window - a multiline edit window + + +Version 0.8.7 prerelease (2009.09.16): * added: new language: Swedish - translation made by: Lars 'Bäfvert' Gäfvert + translation made by: Lars 'Bafvert' Gafvert * changed: version of the TTMath library: 0.9.0 prerelease now Changes from TTMath 0.9.0 prerelease relating to TTCalc: diff --git a/src/Makefile.dep b/src/Makefile.dep index 5eb12b8..d2ee9fb 100644 --- a/src/Makefile.dep +++ b/src/Makefile.dep @@ -1,17 +1,17 @@ -o = resource.o calculation.o convert.o functions.o iniparser.o languages.o mainwindow.o parsermanager.o programresources.o tabs.o variables.o winmain.o +o = resource.o calculation.o convert.o functions.o iniparser.o languages.o mainwindow.o pad.o parsermanager.o programresources.o tabs.o variables.o winmain.o -calculation.o: calculation.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h -convert.o: convert.cpp convert.h compileconfig.h bigtypes.h -functions.o: functions.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -iniparser.o: iniparser.cpp compileconfig.h iniparser.h -languages.o: languages.cpp compileconfig.h languages.h bigtypes.h -mainwindow.o: mainwindow.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h +calculation.o: calculation.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h +convert.o: convert.cpp convert.h compileconfig.h bigtypes.h +functions.o: functions.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h +iniparser.o: iniparser.cpp compileconfig.h iniparser.h +languages.o: languages.cpp compileconfig.h languages.h bigtypes.h +mainwindow.o: mainwindow.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h pad.h +pad.o: pad.cpp programresources.h compileconfig.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h parsermanager.o: parsermanager.cpp compileconfig.h parsermanager.h resource.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h tabs.h messages.h programresources.o: programresources.cpp compileconfig.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -variables.o: variables.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h -winmain.o: winmain.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h - +tabs.o: tabs.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h +variables.o: variables.cpp compileconfig.h tabs.h resource.h messages.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h +winmain.o: winmain.cpp compileconfig.h winmain.h programresources.h iniparser.h languages.h bigtypes.h threadcontroller.h stopcalculating.h convert.h resource.h messages.h tabs.h pad.h .SUFFIXES: .cpp .o diff --git a/src/compileconfig.h b/src/compileconfig.h index 19d9291..f846e75 100644 --- a/src/compileconfig.h +++ b/src/compileconfig.h @@ -61,11 +61,17 @@ /*! - this disables a Visual C++ warning about converting int to bool - "warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)" + this disables a Visual C++ warning + */ #ifdef _MSC_VER + +//"warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)" #pragma warning (disable : 4800) + +// warning C4996: 'sprintf': This function or variable may be unsafe. +#pragma warning (disable : 4996) + #endif #ifndef _WIN32_IE diff --git a/src/languages.cpp b/src/languages.cpp index bd14325..00f726e 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -443,6 +443,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "No&rmal view"); InsertGuiPair(menu_view_compact_view, "C&ompact view"); InsertGuiPair(menu_view_always_on_top, "&Always on top"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&English"); InsertGuiPair(menu_view_lang_polish, "&Polish"); InsertGuiPair(menu_view_lang_spanish, "&Spanish"); @@ -460,6 +461,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "I could not initialize the module for calculations"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "I could not create the second thread for calculating"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "I could not create the main window of the application"); InsertGuiPair(cant_init_common_controls,"I could not initialize the common controls (InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -577,6 +579,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "Widok no&rmalny"); InsertGuiPair(menu_view_compact_view, "Widok &kompaktowy"); InsertGuiPair(menu_view_always_on_top, "Zawsze na &wierzchu"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Angielski"); InsertGuiPair(menu_view_lang_polish, "&Polski"); InsertGuiPair(menu_view_lang_spanish, "&Hiszpañski"); @@ -594,6 +597,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "Nie uda³o siê zainicjalizowaæ modu³u obs³ugi obliczeñ"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "Nie uda³o siê utworzyæ drugiego w¹tku do obliczeñ"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "Nie uda³o siê utworzyæ g³ównego okna aplikacji"); InsertGuiPair(cant_init_common_controls,"Nie uda³o siê zainicjalizowaæ obs³ugi Common Controls (InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -715,6 +719,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "Vista No&rmal"); InsertGuiPair(menu_view_compact_view, "Vista C&ompacta"); InsertGuiPair(menu_view_always_on_top, "&Siempre arriba"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Ingles"); InsertGuiPair(menu_view_lang_polish, "&Polaco"); InsertGuiPair(menu_view_lang_spanish, "&Español"); @@ -732,6 +737,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "No se puede inicializar el modulo de calculo"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "No se puede crear la segunda hebra para calcular"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "No se puede crear la ventana principal par ala aplicacion"); InsertGuiPair(cant_init_common_controls,"No se pueden inicializar los controles comunes (InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -849,6 +855,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "No&rmal visning"); InsertGuiPair(menu_view_compact_view, "K&ompakt visning"); InsertGuiPair(menu_view_always_on_top, "&Altid øverst"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Engelsk"); InsertGuiPair(menu_view_lang_polish, "&Polsk"); InsertGuiPair(menu_view_lang_spanish, "&Spansk"); @@ -866,6 +873,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "Moduelt for uregninger kunne ikke sættes i gang"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "Den anden tråd for udregning kunne ikke laves"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "Applikationens hovedvindue kunne ikke laves"); InsertGuiPair(cant_init_common_controls,"De fælles kontrol indstillinger kunne ikke sættes i gang (InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -982,6 +990,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "&ÆÕͨÊÓͼ"); InsertGuiPair(menu_view_compact_view, "&ÃÔÄãÊÓͼ"); InsertGuiPair(menu_view_always_on_top, "&×ÜÔÚ×îÇ°"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Ó¢Óï"); InsertGuiPair(menu_view_lang_polish, "&²¨À¼Óï"); InsertGuiPair(menu_view_lang_spanish, "&Î÷°àÑÀÓï"); @@ -999,6 +1008,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "²»Äܳõʼ»¯¼ÆËãÆ÷Ä£ÐÍ"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "²»ÄÜ´´½¨Á½¸öÏß³ÌÀ´ÔËËã"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "²»ÄÜ´´½¨Ó¦ÓóÌÐòÖ÷´°¿Ú"); InsertGuiPair(cant_init_common_controls,"²»Äܳõʼ»¯Í¨Óÿؼþ(InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -1113,6 +1123,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "&Îáû÷íûé âèä"); InsertGuiPair(menu_view_compact_view, "&Êîìïàêòíûé âèä"); InsertGuiPair(menu_view_always_on_top, "&Âñåãäà ïîâåðõ äðóãèõ îêîí"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Àíãëèéñêèé"); InsertGuiPair(menu_view_lang_polish, "&Ïîëüñêèé"); InsertGuiPair(menu_view_lang_spanish, "&Èñïàíñêèé"); @@ -1130,6 +1141,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "Íå ìîãó èíèöèàëèçèðîâàòü ìîäóëü äëÿ ðàñ÷åòîâ"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "Íå ìîãó ñîçäàòü âòîðîé ïîòîê äëÿ ðàñ÷åòîâ"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "Íå ìîãó îòêðûòü ãëàâíîå îêíî ïðîãðàììû"); InsertGuiPair(cant_init_common_controls,"Íå ìîãó èíèöèàëèçèðîâàòü óïðàâëåíèå (InitCommonControlsEx)"); InsertGuiPair(about_text, @@ -1247,6 +1259,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "No&rmal visning"); InsertGuiPair(menu_view_compact_view, "K&ompakt visning"); InsertGuiPair(menu_view_always_on_top, "&Alltid överst"); + InsertGuiPair(menu_view_pad, "&Pad"); InsertGuiPair(menu_view_lang_english, "&Engelska"); InsertGuiPair(menu_view_lang_polish, "&Polska"); InsertGuiPair(menu_view_lang_spanish, "&Spanska"); @@ -1264,6 +1277,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(cant_init_calculations, "Beräkningen kunde inte initieras!"); InsertGuiPair(message_box_error_caption,"TTCalc"); InsertGuiPair(cant_create_thread, "Den andra tråden för uträkning kunde inte skapas"); + InsertGuiPair(cant_create_pad, "I could not create the pad window"); InsertGuiPair(cant_create_main_window, "Applikationens huvudfönster kunde inte skapas"); InsertGuiPair(cant_init_common_controls,"Inställningarna kunde inte initieras (InitCommonControlsEx)"); InsertGuiPair(about_text, diff --git a/src/languages.h b/src/languages.h index 1e56a48..2797712 100644 --- a/src/languages.h +++ b/src/languages.h @@ -115,6 +115,7 @@ public: menu_view_normal_view, menu_view_compact_view, menu_view_always_on_top, + menu_view_pad, menu_view_lang_english, menu_view_lang_polish, menu_view_lang_spanish, @@ -132,6 +133,7 @@ public: cant_init_calculations, message_box_error_caption, cant_create_thread, + cant_create_pad, cant_create_main_window, cant_init_common_controls, cant_find_help, diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2fa568c..da7663d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -402,6 +402,7 @@ HMENU menu = GetMenu(hWnd); SetMenuLanguageItem(menu, IDM_NORMAL_VIEW, Languages::menu_view_normal_view); SetMenuLanguageItem(menu, IDM_COMPACT_VIEW, Languages::menu_view_compact_view); SetMenuLanguageItem(menu, IDM_ALWAYS_ON_TOP, Languages::menu_view_always_on_top); + SetMenuLanguageItem(menu, IDM_PAD, Languages::menu_view_pad); SetMenuLanguageItem(menu, IDM_LANGUAGE_ENGLISH, Languages::menu_view_lang_english); SetMenuLanguageItem(menu, IDM_LANGUAGE_POLISH, Languages::menu_view_lang_polish); SetMenuLanguageItem(menu, IDM_LANGUAGE_SPANISH, Languages::menu_view_lang_spanish); @@ -764,6 +765,15 @@ void WmInitMenuPopUpView(HMENU menu) } + if( GetPrgRes()->IsPadVisible() ) + { + CheckMenuItem(menu,IDM_PAD,MF_BYCOMMAND|MF_CHECKED); + } + else + { + CheckMenuItem(menu,IDM_PAD,MF_BYCOMMAND|MF_UNCHECKED); + } + // languages @@ -891,6 +901,14 @@ return true; } +BOOL WmCommand_Pad(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + GetPrgRes()->TurnPad(); + +return true; +} + + BOOL WmCommand_HelpAbout(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { DialogBox(GetPrgRes()->GetInstance(),MAKEINTRESOURCE(IDD_ABOUT_DIALOG),hWnd,AboutProc); @@ -1155,11 +1173,12 @@ return true; } -void CreateCommandMessagesTable(Messages & cmessages) +void CreateCommandMessagesTable(Messages & cmessages) { cmessages.Associate(IDM_ALWAYS_ON_TOP, WmCommand_AlwaysOnTop); cmessages.Associate(IDM_NORMAL_VIEW, WmCommand_NormalView); cmessages.Associate(IDM_COMPACT_VIEW, WmCommand_CompactView); + cmessages.Associate(IDM_PAD, WmCommand_Pad); cmessages.Associate(IDM_HELP_ABOUT, WmCommand_HelpAbout); cmessages.Associate(IDM_NEW_WINDOW, WmCommand_NewWindow); cmessages.Associate(IDM_CLOSE_PROGRAM, WmCommand_CloseProgram); @@ -1182,7 +1201,7 @@ void CreateCommandMessagesTable(Messages & cmessages) BOOL WmCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { -static Messages command_messages; +static Messages command_messages; if( command_messages.Empty() ) // initiation @@ -1196,7 +1215,7 @@ static Messages command_messages; -void CreateMainMessagesTable(Messages & messages) +void CreateMainMessagesTable(Messages & messages) { messages.Associate(WM_INITDIALOG, WmInitDialog); messages.Associate(WM_MOVE, WmMove); diff --git a/src/messages.h b/src/messages.h index 4dad6a8..f68e80d 100644 --- a/src/messages.h +++ b/src/messages.h @@ -42,10 +42,12 @@ #include + +template class Messages { public: - typedef BOOL (*MessageFunction)(HWND, UINT, WPARAM, LPARAM); + typedef ProcReturnType (*MessageFunction)(HWND, UINT, WPARAM, LPARAM); typedef std::map MessageTable; @@ -61,19 +63,28 @@ public: } - bool Call(UINT key, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) + ProcReturnType Call(UINT key, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool * method_exists = 0) { - MessageTable::iterator i = message_table.find(key); + typename MessageTable::iterator i = message_table.find(key); if( i == message_table.end() ) + { + if( method_exists ) + *method_exists = false; + return false; + } + + if( method_exists ) + *method_exists = true; return i->second(hWnd, message, wParam, lParam); } + bool IsMessage(UINT key) { - MessageTable::iterator i = message_table.find(key); + typename MessageTable::iterator i = message_table.find(key); if( i == message_table.end() ) return false; diff --git a/src/programresources.cpp b/src/programresources.cpp index a55af23..7a1fa5a 100644 --- a/src/programresources.cpp +++ b/src/programresources.cpp @@ -376,6 +376,16 @@ HWND ProgramResources::GetMainWindow() return main_window; } +void ProgramResources::SetPadWindow(HWND h) +{ + pad_window = h; +} + +HWND ProgramResources::GetPadWindow() +{ + return pad_window; +} + void ProgramResources::SetTabWindow(unsigned int id, HWND h) { if( id >= sizeof(tab_window) / sizeof(HWND) ) @@ -430,6 +440,26 @@ int ProgramResources::GetPrecision() +void ProgramResources::TurnPad() +{ + show_pad = !show_pad; + + if( show_pad ) + { + ShowWindow(pad_window, SW_SHOW); + } + else + { + ShowWindow(pad_window, SW_HIDE); + } +} + + +bool ProgramResources::IsPadVisible() +{ + return show_pad; +} + ProgramResources::ProgramResources() { // if you want to change the input buffer you have also to change @@ -481,6 +511,8 @@ ProgramResources::ProgramResources() variables_id = 0; functions_id = 0; + + show_pad = false; } diff --git a/src/programresources.h b/src/programresources.h index c8c2ead..de9723d 100644 --- a/src/programresources.h +++ b/src/programresources.h @@ -43,12 +43,13 @@ \brief various kinds of objects using by the application */ -#include +#include "compileconfig.h" #include "iniparser.h" #include "languages.h" #include "threadcontroller.h" #include "convert.h" +#include #include #include #include @@ -198,6 +199,9 @@ public: HWND GetMainWindow(); + void SetPadWindow(HWND h); + HWND GetPadWindow(); + /*! handles to the dialogs which are placed on the tab control */ @@ -339,6 +343,19 @@ public: void SetDegRadGrad(int angle); int GetDegRadGrad(); + + /*! + is the pad window is visible then the method hides it (and vice versa) + */ + void TurnPad(); + + + /*! + returning true if the pad window is visible + */ + bool IsPadVisible(); + + private: bool IsWhiteCharacter(int c); @@ -363,6 +380,7 @@ private: HINSTANCE hInstance; HWND main_window; + HWND pad_window; HWND tab_window[6]; int precision; @@ -393,7 +411,7 @@ private: int angle_deg_rad_grad; int bad_line; - + bool show_pad; }; diff --git a/src/resource.h b/src/resource.h index d004595..d7fea6f 100644 --- a/src/resource.h +++ b/src/resource.h @@ -187,11 +187,12 @@ #define IDM_VIEW_INDEX 0 #define IDM_EDIT_INDEX 1 #define IDM_HELP_INDEX 2 -#define IDM_LANGUAGE_INDEX 6 +#define IDM_LANGUAGE_INDEX 8 #define IDM_NEW_WINDOW 40001 #define IDM_NORMAL_VIEW 40002 #define IDM_COMPACT_VIEW 40003 #define IDM_ALWAYS_ON_TOP 40004 +#define IDM_PAD 40005 #define IDM_LANGUAGE_ENGLISH 40010 #define IDM_LANGUAGE_POLISH 40011 #define IDM_LANGUAGE_SPANISH 40012 diff --git a/src/resource.rc b/src/resource.rc index 48bf13b..ed603af 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -23,6 +23,8 @@ BEGIN MENUITEM "No&rmal", 40002 MENUITEM "&Compact", 40003 MENUITEM SEPARATOR + MENUITEM "&Pad", 40005 + MENUITEM SEPARATOR MENUITEM "&Always on top", 40004 POPUP "&Language" BEGIN diff --git a/src/stopcalculating.h b/src/stopcalculating.h index 68d789e..20f0291 100644 --- a/src/stopcalculating.h +++ b/src/stopcalculating.h @@ -43,6 +43,7 @@ \brief it tells us whether there was a stop signal or not */ +#include "compileconfig.h" #include #include diff --git a/src/tabs.cpp b/src/tabs.cpp index 89c2f67..a4864c3 100644 --- a/src/tabs.cpp +++ b/src/tabs.cpp @@ -919,7 +919,7 @@ return true; -void CreateTabCommandMessagesTable(Messages & cmessages) +void CreateTabCommandMessagesTable(Messages & cmessages) { cmessages.Associate(IDC_BUTTON_PRESS_0, WmTabCommand_Press_0_9); cmessages.Associate(IDC_BUTTON_PRESS_1, WmTabCommand_Press_0_9); @@ -1006,7 +1006,7 @@ void CreateTabCommandMessagesTable(Messages & cmessages) */ BOOL WmTabCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { -static Messages command_messages; +static Messages command_messages; if( command_messages.Empty() ) // initiation @@ -1388,7 +1388,7 @@ return false; -void CreateTabMessagesTable(Messages & messages) +void CreateTabMessagesTable(Messages & messages) { messages.Associate(WM_INITDIALOG, WmTabInitDialog); messages.Associate(WM_COMMAND, WmTabCommand); @@ -1412,7 +1412,7 @@ void CreateTabMessagesTable(Messages & messages) BOOL CALLBACK TabWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { -static Messages messages; +static Messages messages; if( messages.Empty() ) // initiation diff --git a/src/winmain.cpp b/src/winmain.cpp index f0c130d..0bca8a0 100644 --- a/src/winmain.cpp +++ b/src/winmain.cpp @@ -82,6 +82,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) if( !GetPrgRes()->GetMainWindow() ) return ShowError( Languages::cant_create_main_window ); + if( !CreatePadWindow() ) + return ShowError( Languages::cant_create_pad ); + // there's the main loop of messages here MainMessagesLoop(); @@ -185,7 +188,7 @@ MSG msg; */ BOOL CALLBACK MainWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { -static Messages messages; +static Messages messages; if( messages.Empty() ) // initiation diff --git a/src/winmain.h b/src/winmain.h index 382fe90..9f8b23c 100644 --- a/src/winmain.h +++ b/src/winmain.h @@ -47,6 +47,7 @@ #include "resource.h" #include "messages.h" #include "tabs.h" +#include "pad.h" #include #include @@ -66,7 +67,7 @@ namespace MainWindowFunctions bool SetNextFocus(WPARAM wParam); bool CopyResult(); bool Paste(); - void CreateMainMessagesTable(Messages & messages); + void CreateMainMessagesTable(Messages & messages); BOOL CALLBACK AboutProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); }