Index: src/ch/TMsgBox.cpp =================================================================== diff -u -N -r096451721a732567aad7e103bfe2d0a9f2f32c95 -r2648234e4e3ce1cf79d1bad88a94d07315e1e694 --- src/ch/TMsgBox.cpp (.../TMsgBox.cpp) (revision 096451721a732567aad7e103bfe2d0a9f2f32c95) +++ src/ch/TMsgBox.cpp (.../TMsgBox.cpp) (revision 2648234e4e3ce1cf79d1bad88a94d07315e1e694) @@ -30,13 +30,15 @@ ON_BN_CLICKED(IDC_THIRD_BUTTON, &TMsgBox::OnThirdButtonClicked) ON_NOTIFY(EN_REQUESTRESIZE, IDC_MSG_RICHEDIT, OnRichEditResize) ON_NOTIFY(EN_REQUESTRESIZE, IDC_MEASURE_RICHEDIT, OnRichEditResize) + ON_WM_GETMINMAXINFO() END_MESSAGE_MAP() TMsgBox::TMsgBox(UINT uiMsgResourceID, EButtonConfig eButtons, EIconConfig eIcon, CWnd* pParent /*= NULL*/) : CLanguageDialog(IDD_MSGBOX_DIALOG, pParent), m_eButtons(eButtons), m_eIcon(eIcon), - m_rcRichEdit(0,0,0,0) + m_rcRichEdit(0,0,0,0), + m_rcDialogMinSize(0,0,0,0) { m_strMessageText = GetResManager().LoadString(uiMsgResourceID); } @@ -84,6 +86,8 @@ m_ctlRichEdit.GetWindowRect(&m_rcRichEdit); ScreenToClient(&m_rcRichEdit); + GetWindowRect(&m_rcDialogMinSize); + // initialize controls' texts InitializeControls(); @@ -286,11 +290,12 @@ int iNewHeight = rcThis.Height() + iHeightDiff; // make sure we don't exceed the max size - if(iNewHeight > sizeMax.cy) - iNewHeight = sizeMax.cy; - if(iNewWidth > sizeMax.cx) - iNewWidth = sizeMax.cx; + iNewHeight = std::min((int)sizeMax.cy, iNewHeight); + iNewWidth = std::min((int)sizeMax.cx, iNewWidth); + iNewWidth = std::max(m_rcDialogMinSize.Width(), iNewWidth); + iNewHeight = std::max(m_rcDialogMinSize.Height(), iNewHeight); + // move window SetWindowPos(NULL, 0, 0, iNewWidth, iNewHeight, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); @@ -351,3 +356,12 @@ return sizeMax; } + +void TMsgBox::OnGetMinMaxInfo(MINMAXINFO* lpMMI) +{ + if(!m_rcDialogMinSize.IsRectNull()) + { + lpMMI->ptMinTrackSize.x = m_rcDialogMinSize.Width(); + lpMMI->ptMinTrackSize.y = m_rcDialogMinSize.Height(); + } +} Index: src/ch/TMsgBox.h =================================================================== diff -u -N -r096451721a732567aad7e103bfe2d0a9f2f32c95 -r2648234e4e3ce1cf79d1bad88a94d07315e1e694 --- src/ch/TMsgBox.h (.../TMsgBox.h) (revision 096451721a732567aad7e103bfe2d0a9f2f32c95) +++ src/ch/TMsgBox.h (.../TMsgBox.h) (revision 2648234e4e3ce1cf79d1bad88a94d07315e1e694) @@ -51,6 +51,7 @@ protected: virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); + void OnGetMinMaxInfo(MINMAXINFO* lpMMI); void InitializeControls(); @@ -78,6 +79,7 @@ CString m_strCheckboxText; CRect m_rcRichEdit; + CRect m_rcDialogMinSize; protected: DECLARE_MESSAGE_MAP() Index: src/ch/ch.cpp =================================================================== diff -u -N -r096451721a732567aad7e103bfe2d0a9f2f32c95 -r2648234e4e3ce1cf79d1bad88a94d07315e1e694 --- src/ch/ch.cpp (.../ch.cpp) (revision 096451721a732567aad7e103bfe2d0a9f2f32c95) +++ src/ch/ch.cpp (.../ch.cpp) (revision 2648234e4e3ce1cf79d1bad88a94d07315e1e694) @@ -425,10 +425,17 @@ } // tmp - //CString strLongText = _T("This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\n"); - //TMsgBox msgBox(strLongText, TMsgBox::eOkCancel, TMsgBox::eIcon_Warning); - //if(msgBox.DoModal()) - // return -1; +/* + CString strShortText = _T("Short info only"); + TMsgBox msgBox1(strShortText, TMsgBox::eOk, TMsgBox::eIcon_Info); + if(msgBox1.DoModal()) + strShortText;// return -1; + + CString strLongText = _T("This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line. This is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\nThis is some very very long text to be displayed in the text message box. There is no formatting applied (unfortunately) and we don't have any plans to incorporate it. This text should be split into multiple lines to avoid making dialog box too big.\nThere is also a shorter second line.\n"); + TMsgBox msgBox(strLongText, TMsgBox::eOkCancel, TMsgBox::eIcon_Warning); + if(msgBox.DoModal()) + return -1; +*/ // /tmp // ================================= Shell extension ======================================== Index: src/ch/ch.rc =================================================================== diff -u -N -r096451721a732567aad7e103bfe2d0a9f2f32c95 -r2648234e4e3ce1cf79d1bad88a94d07315e1e694 --- src/ch/ch.rc (.../ch.rc) (revision 096451721a732567aad7e103bfe2d0a9f2f32c95) +++ src/ch/ch.rc (.../ch.rc) (revision 2648234e4e3ce1cf79d1bad88a94d07315e1e694) @@ -18,30 +18,28 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Dialog // -IDD_MSGBOX_DIALOG DIALOGEX 0, 0, 177, 83 +IDD_MSGBOX_DIALOG DIALOGEX 0, 0, 177, 70 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "Copy Handler" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - PUSHBUTTON "Btn2",IDC_SECOND_BUTTON,64,62,50,14 - PUSHBUTTON "Btn3",IDC_THIRD_BUTTON,120,62,50,14 + PUSHBUTTON "Btn2",IDC_SECOND_BUTTON,63,49,50,14 + PUSHBUTTON "Btn3",IDC_THIRD_BUTTON,119,49,50,14 ICON "",IDC_IMAGE_STATIC,13,13,21,20,SS_REALSIZEIMAGE - CONTROL "Do not show this again",IDC_BASIC_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,163,10 - PUSHBUTTON "Btn1",IDC_FIRST_BUTTON,8,62,50,14 - CONTROL "",IDC_MSG_RICHEDIT,"RichEdit20W",ES_MULTILINE | ES_READONLY | WS_DISABLED | WS_TABSTOP,43,13,127,31 + CONTROL "Do not show this again",IDC_BASIC_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,36,163,10 + PUSHBUTTON "Btn1",IDC_FIRST_BUTTON,7,49,50,14 + CONTROL "",IDC_MSG_RICHEDIT,"RichEdit20W",ES_MULTILINE | ES_READONLY | WS_DISABLED | WS_TABSTOP,43,13,127,20 CONTROL "",IDC_MEASURE_RICHEDIT,"RichEdit20W",ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,7,7,11,7 END @@ -413,14 +411,14 @@ // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_MSGBOX_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 170 TOPMARGIN, 7 - BOTTOMMARGIN, 76 + BOTTOMMARGIN, 63 END IDD_BUFFERSIZE_DIALOG, DIALOG @@ -584,7 +582,7 @@ // Menu // -IDR_POPUP_MENU MENU +IDR_POPUP_MENU MENU BEGIN POPUP "POPUP" BEGIN @@ -611,7 +609,7 @@ END END -IDR_PRIORITY_MENU MENU +IDR_PRIORITY_MENU MENU BEGIN POPUP "_POPUP_" BEGIN @@ -668,7 +666,7 @@ // String Table // -STRINGTABLE +STRINGTABLE BEGIN IDS_ONECOPY_STRING "Cannot run the second instance of this program" IDS_REGISTEROK_STRING "Integration with system enabled successfully." @@ -682,7 +680,7 @@ IDS_CHEXT_ALREADY_UNREGISTERED "Integration with system already disabled." END -STRINGTABLE +STRINGTABLE BEGIN IDS_BROWSE_STRING "Choose path" IDS_BDREMOTENAME_STRING "Remote name: " @@ -694,7 +692,7 @@ IDS_BDCAPACITY_STRING "Capacity: " END -STRINGTABLE +STRINGTABLE BEGIN IDS_FILEDLGALLFILTER_STRING "All files (*)|*||" IDS_DSTFOLDERBROWSE_STRING "Choose destination folder" @@ -706,7 +704,7 @@ IDS_BSETWODISKS_STRING "Two disks: %size" END -STRINGTABLE +STRINGTABLE BEGIN IDS_APPNAME_STRING "Copy Handler" IDS_PRIORITY0_STRING "Time critical" @@ -718,12 +716,12 @@ IDS_PRIORITY6_STRING "Idle" END -STRINGTABLE +STRINGTABLE BEGIN IDS_MINIVIEWALL_STRING "All:" END -STRINGTABLE +STRINGTABLE BEGIN IDS_PROGRAM_STRING "Program" IDS_CLIPBOARDMONITORING_STRING "Clipboard monitoring" @@ -743,7 +741,7 @@ IDS_MINIVIEWSHOWAFTERSTART_STRING "Show at program startup" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CFGSHSHOWICONS_STRING "Show icons with shortcuts (experimental)" IDS_CFGSHINTERCEPTDRAG_STRING @@ -764,7 +762,7 @@ IDS_FORCESHUTDOWNVALUES_STRING "Normal!Force" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CFGINTERCEPTCONTEXTMENU_STRING "Intercept standard Windows operations (experimental/not recommended)" @@ -775,7 +773,7 @@ IDS_UPDATE_FREQUENCIES "Never!Every startup!Daily!Weekly!Once every 2 weeks!Monthly!Quarterly" END -STRINGTABLE +STRINGTABLE BEGIN IDS_MINIVIEWAUTOHIDE_STRING "Hide when empty" IDS_PROCESSINGTHREAD_STRING "Copying/moving thread" @@ -792,7 +790,7 @@ "Don't delete files before copying finishes (moving)" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CREATELOGFILES_STRING "Create .log files" IDS_SOUNDS_STRING "Sounds" @@ -815,20 +813,20 @@ IDS_FORCESHUTDOWN_STRING "Type of shutdown" END -STRINGTABLE +STRINGTABLE BEGIN IDS_SOURCESTRINGMISSING_STRING "You didn't enter source text" END -STRINGTABLE +STRINGTABLE BEGIN IDS_COLUMNSTATUS_STRING "Status" IDS_COLUMNSOURCE_STRING "File" IDS_COLUMNDESTINATION_STRING "To:" IDS_COLUMNPROGRESS_STRING "Progress" END -STRINGTABLE +STRINGTABLE BEGIN IDS_EMPTYOPERATIONTEXT_STRING "None of tasks selected" IDS_EMPTYSOURCETEXT_STRING "empty" @@ -848,12 +846,12 @@ IDS_NONEINPUTFILE_STRING "none" END -STRINGTABLE +STRINGTABLE BEGIN IDS_BUFFERSIZEZERO_STRING "Cannot operate with buffer of 0 size" END -STRINGTABLE +STRINGTABLE BEGIN IDS_TITLECOPY_STRING "Copying..." IDS_TITLEMOVE_STRING "Moving..." @@ -862,14 +860,14 @@ IDS_MAINBROWSETEXT_STRING "Enter destination path for:\n" END -STRINGTABLE +STRINGTABLE BEGIN IDS_STATUS_INITIALIZING_STRING "Initializing" IDS_STATUS_FASTMOVE_STRING "Fast moving" IDS_EMPTYSUBTASKNAME_STRING "none" END -STRINGTABLE +STRINGTABLE BEGIN IDS_STATUS_SEARCHING_STRING "Searching" IDS_STATUS_COPYING_STRING "Copying" @@ -888,7 +886,7 @@ IDS_BSDEFAULT_STRING "Default: " END -STRINGTABLE +STRINGTABLE BEGIN IDS_FIRSTCOPY_STRING "Copy of %name" IDS_NEXTCOPY_STRING "Copy (%count) of %name" @@ -910,7 +908,7 @@ "You have a newer version of Copy Handler than is available on the official web page.\n\nYour current version: %thisver\nVersion available on site: %officialver." END -STRINGTABLE +STRINGTABLE BEGIN IDS_BSONEDISK_STRING "One disk: " IDS_BSTWODISKS_STRING "Two disks: " @@ -922,13 +920,13 @@ "Selected task wasn't finished yet.\nDo you want to finish it now ?" END -STRINGTABLE +STRINGTABLE BEGIN IDS_SHUTDOWNERROR_STRING "Cannot shutdown this operating system.\nEncountered error #%errno." END -STRINGTABLE +STRINGTABLE BEGIN IDS_MINIVIEWSMOOTHPROGRESS_STRING "Use smooth progress bars" IDS_CFGFOLDERDIALOG_STRING "Choose folder dialog" @@ -951,7 +949,7 @@ IDS_CFGSHSHOWFREESPACE_STRING "Show free space with shortcuts' names" END -STRINGTABLE +STRINGTABLE BEGIN IDS_BSECD_STRING "CD: %size" IDS_BSELAN_STRING "LAN: %size" @@ -971,7 +969,7 @@ IDS_IMPORTREPORT_STRING "Imported %count path(s)" END -STRINGTABLE +STRINGTABLE BEGIN IDS_IMPORTERROR_STRING "Cannot import paths from the specified file" IDS_ERROR_INITIALIZING_COMMON_CONTROLS @@ -980,14 +978,14 @@ "Cannot initialize rich edit contro. The application will now exit." END -STRINGTABLE +STRINGTABLE BEGIN IDS_DATECREATED_STRING "Date of creation" IDS_DATELASTWRITE_STRING "Date of last write" IDS_DATEACCESSED_STRING "Date of last access" END -STRINGTABLE +STRINGTABLE BEGIN IDS_MENUCOPY_STRING "(CH) Copy here" IDS_MENUMOVE_STRING "(CH) Move here" @@ -999,7 +997,7 @@ IDS_MENUCOPYMOVETOSPECIAL_STRING "(CH) Copy/move special to..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_MENUTIPCOPY_STRING "Copies data here with Copy Handler" IDS_MENUTIPMOVE_STRING "Moves data here with Copy Handler" @@ -1014,7 +1012,7 @@ "Copies/moves selected data into specified folder with additional settings" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CFGFDSHORTCUTSSTYLES_STRING "Large icons!Small icons!List!Report" IDS_CFGPRIORITYCLASSITEMS_STRING "Idle!Normal!High!Real-time" @@ -1031,13 +1029,13 @@ "Current language: %langname, Author(s): %authors" END -STRINGTABLE +STRINGTABLE BEGIN IDS_SHORTCUTNAME_STRING "Shortcut's name" IDS_SHORTCUTPATH_STRING "Path" END -STRINGTABLE +STRINGTABLE BEGIN IDS_BDOK_STRING "&OK" IDS_BDCANCEL_STRING "&Cancel" @@ -1058,7 +1056,7 @@ IDS_BDDETAILS_STRING "Details" END -STRINGTABLE +STRINGTABLE BEGIN IDS_BDADDSHORTCUT_STRING "Add to shortcut's list" IDS_BDREMOVESHORTCUT_STRING "Remove from shortcut's list" @@ -1078,7 +1076,7 @@ IDS_INFO_MODIFIED_STRING "Modified: %datemod" END -STRINGTABLE +STRINGTABLE BEGIN IDS_INFO_TWO_FILE_STRING "Source file: %filename\nDestination file: %dstfilename" @@ -1088,17 +1086,17 @@ IDS_NO_STRING "&No" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ABOUTVERSION_STRING "Compilation: " END -STRINGTABLE +STRINGTABLE BEGIN IDS_NERPATH_STRING "There is not enough room in %path to copy or move:" END -STRINGTABLE +STRINGTABLE BEGIN IDS_UPDATER_EQUAL_VERSION_STRING "You already have the newest version of Copy Handler.\n\nYour current version: %thisver\nVersion available on site: %officialver." @@ -1119,12 +1117,12 @@ "Failed to load task list database. Copy Handler will create a new, empty database for you." END -STRINGTABLE +STRINGTABLE BEGIN IDS_INFO_REASON_STRING "Reason: %reason" END -#endif // English (U.S.) resources +#endif // English (United States) resources /////////////////////////////////////////////////////////////////////////////