LRESULT CSidebarDlg::OnInitDialog( PROPSHEETPAGE *p ) { m_FolderHeader.Attach(GetDlgItemHandle(IDC_FOLDER_HEADER)); TCHAR szFolder[MAX_PATH]; GetLogFolder(szFolder, MAX_PATH); m_FolderLink.Attach(GetDlgItemHandle( IDC_LOGFOLDER_LINK )); m_FolderLink.SetWindowText(szFolder); m_FolderLink.ShowToolTip(); m_FolderLink.VisitedColor() = m_FolderLink.NormalColor(); m_SmallButton.Attach(GetDlgItemHandle( IDB_SMALL_SIDEBAR )); m_SmallButton.SetXPStyle(); m_SmallButton.Tip() = ClsString(_T("Show/Hide Sidebar (Ctrl+S)")); m_SmallButton.ShowToolTip(); m_SidebarHeader.Attach( GetDlgItemHandle( IDC_SIDEBAR_HEADER )); m_SidebarHeader.Gradient() = TRUE; m_SidebarHeader.BackgroundColor() = ::GetSysColor( COLOR_INACTIVECAPTION ); m_SidebarHeader.BackgroundGradient() = ::GetSysColor( COLOR_GRADIENTINACTIVECAPTION ); m_FilterText.Attach(GetDlgItemHandle(IDC_FILTER_TEXT)); m_FilterBox.Attach(GetDlgItemHandle(IDC_FILTER_BOX)); m_FilterButton.Attach(GetDlgItemHandle(IDC_FILTER_BUTTON)); m_ChangeFolderBtn.Attach(GetDlgItemHandle(IDC_CHANGE_FOLDER_BUTTON)); m_Animate.Attach(GetDlgItemHandle( IDC_ANIMATE )); m_Animate.Open((LPTSTR)IDR_DOWNLOAD_AVI); m_Animate.Play(); m_LogFileListCtrl.Attach(GetDlgItemHandle( IDC_LOGFILE_LIST )); return ClsDialog::OnInitDialog(p); }
// WM_INITDIALOG handler. LRESULT KeyboardPage::OnInitDialog( PROPSHEETPAGE * pPropSheetPage ) { // Wrap controls. m_Tools.Attach( GetDlgItemHandle( IDC_TOOLS )); m_Tools.SetupToolbar( TRUE, FALSE, FALSE, FALSE ); m_ComTools.Attach( GetDlgItemHandle( IDC_COMTOOLS )); m_ComTools.SetupToolbar( TRUE, TRUE, FALSE, FALSE ); m_Keys.Attach( GetDlgItemHandle( IDC_KEYS )); m_Commands.Attach( GetDlgItemHandle( IDC_COMMANDS )); // Create the menu. CreatePopupMenu(); // Call the base-class. return Page::OnInitDialog( pPropSheetPage ); }
// WM_INITDIALOG handler. LRESULT KeywordEdit::OnInitDialog( LPPROPSHEETPAGE pPsp ) { // Setup controls. m_Tools.Attach( GetDlgItemHandle( IDC_TOOLS )); m_Tools.SetupToolbar( TRUE, FALSE, FALSE, TRUE, TRUE ); m_Keys.Attach( GetDlgItemHandle( IDC_KEYS )); m_Keys.SetupToolbar( FALSE, FALSE, TRUE, FALSE ); m_List.Attach( GetDlgItemHandle( IDC_LIST )); m_KeyList.Attach( GetDlgItemHandle( IDC_WORDS )); m_Case.Attach( GetDlgItemHandle( IDC_CASE )); // Setup values. m_Case.SetCheck( m_bCase ? BST_CHECKED : BST_UNCHECKED ); m_List.SetKeywordList( &m_KeyLst ); // Setup the GUI. SetupControls(); return TRUE; }
// WM_INITDIALOG message handler... virtual LRESULT OnInitDialog( PROPSHEETPAGE *p ) { // Loadup and set icon. m_hIcon = ( HICON )::LoadImage( ClsGetApp()->GetResourceHandle(), MAKEINTRESOURCE( IDI_FIND ), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR ); SetIcon( m_hIcon, FALSE ); // Create layout engine controls. We do this before "ClsDialog" get's // a chance to distribute it's font to it's children so that when it does // the layout engine controls will get the font set too. m_Master.Create( *this, Offsets( 6, 6, 6, ::GetSystemMetrics( SM_CYHSCROLL )), LAYOUT_Master, TRUE, LAYOUT_Horizontal, FALSE, TAG_END ); m_Left.Create( *this, Offsets( 0, 0, 0, 0 ), LAYOUT_Horizontal, FALSE, LAYOUT_EqualMinWidth, TRUE, TAG_END ); m_Right.Create( *this, Offsets( 0, 0, 0, 0 ), LAYOUT_Horizontal, FALSE, TAG_END ); m_StatBut.Create( *this, Offsets( 0, 0, 0, 0 ), LAYOUT_Horizontal, TRUE, TAG_END ); m_LeftRight.Create( *this, Offsets( 0, 0, 0, 0 ), LAYOUT_Spacing, 6, LAYOUT_Horizontal, TRUE, TAG_END ); // Setup infobar control. m_Proc.Attach( GetDlgItemHandle( IDC_PROC )); m_Proc.CompactAsPath() = TRUE; // Setup list. m_List.Attach( GetDlgItemHandle( IDC_LIST )); m_List.SetExtendedListViewStyle( LVS_EX_FULLROWSELECT ); m_List.InsertColumn( 0, _T( "File" )); m_List.InsertColumn( 1, _T( "Line Nr." )); m_List.InsertColumn( 2, _T( "Line" )); // Setup other controls. m_Find.Attach( GetDlgItemHandle( IDC_FIND )); m_Type.Attach( GetDlgItemHandle( IDC_TYPES )); m_Case.Attach( GetDlgItemHandle( IDC_CASE )); m_Recur.Attach( GetDlgItemHandle( IDC_RECUR )); m_Folder.Attach( GetDlgItemHandle( IDC_FOLDER )); m_Folder.ShowFiles() = FALSE; m_Folder.LoadingTextColor() = RGB( 255, 0, 0 ); m_Occ.Attach( GetDlgItemHandle( IDC_OCC )); m_Go.Attach( GetDlgItemHandle( IDC_GO )); m_About.Attach( GetDlgItemHandle( IDC_ABOUT )); // Call the base class. The base will also distribute the // dialog font. return ClsSizeDialog::OnInitDialog( p ); }
// WM_INITDIALOG handler. virtual LRESULT OnInitDialog( PROPSHEETPAGE *psp ) { // Setup icon. SendMessage( WM_SETICON, ICON_SMALL, ( WPARAM )::LoadIcon( NULL, IDI_APPLICATION )); // Attach (subclass) the controls. left.Attach( GetDlgItemHandle( IDC_VERTTOP )); left.SetIcon( MAKEINTRESOURCE( IDI_TOP )); left.Gradient() = FALSE; left.Vertical() = TRUE; left.BackgroundColor() = ::GetSysColor( COLOR_ACTIVECAPTION ); top.Attach( GetDlgItemHandle( IDC_HORIZLEFT )); top.SetIcon( MAKEINTRESOURCE( IDI_RIGHT )); right.Attach( GetDlgItemHandle( IDC_VERTBOTTOM )); right.SetIcon( MAKEINTRESOURCE( IDI_BOTTOM )); right.IconRight() = FALSE; right.Gradient() = TRUE; right.Vertical() = TRUE; right.BackgroundColor() = ::GetSysColor( COLOR_ACTIVECAPTION ); right.BackgroundGradient() = ::GetSysColor( COLOR_GRADIENTACTIVECAPTION ); bottom.Attach( GetDlgItemHandle( IDC_HORIZRIGHT )); bottom.SetIcon( MAKEINTRESOURCE( IDI_LEFT )); bottom.IconRight() = FALSE; bottom.Gradient() = TRUE; desc.Attach( GetDlgItemHandle( IDC_DESC )); desc.SetWindowText( ISEQ_CENTER _T( "A couple of \"" ISEQ_BOLD "ClsInfoBar" ISEQ_NORMAL "\" controls\n\n" ) _T( "BTW. This descriptive text is shown in a\n" ) _T( "\"" ISEQ_BOLD "ClsInfoControl" ISEQ_NORMAL "\" control.\n\n" ) _T( "By using command sequences in the text this\ncontrol can show text styles like:\n\n" ) ISEQ_BOLD _T( "Bold" ) ISEQ_NORMAL _T( "," ) ISEQ_ITALIC _T( "Italic" ) ISEQ_NORMAL _T( "," ) ISEQ_UNDERLINE _T( "Underline" ) ISEQ_NORMAL _T( ", and " ) ISEQ_BOLD ISEQ_ITALIC ISEQ_UNDERLINE _T( "Combinations" ) ISEQ_NORMAL _T( "\n\n" ) _T( "Also text in " ) ISEQ_BACKRGB( "255,255,0" ) ISEQ_TEXTRGB( "255,0,0C" ) ISEQ_TEXTRGB( "0,155,0o" ) ISEQ_TEXTRGB( "0,0,255l" ) ISEQ_TEXTRGB( "0,155,0o" ) ISEQ_TEXTRGB( "255,0,0r" ) ISEQ_TEXTRGB( "0,155,0s" ) ISEQ_TEXTSYSCOLOR( IG_COLOR_BTNTEXT ) ISEQ_BACKSYSCOLOR( IG_COLOR_BTNFACE ) _T( " is possible...\n\n" ) _T( "Besides that text can also be\n\n" ) ISEQ_LEFT _T( "left aligned\n" ) ISEQ_RIGHT _T( "right aligned\n" ) ISEQ_CENTER _T( "or centered" )); button.Attach( GetDlgItemHandle( IDC_OK )); button.SetHotFrame(); // Pass to the base class. return ClsDialog::OnInitDialog( psp ); }
LRESULT KeyRec::OnCommand( UINT nNotifyCode, UINT nCtrlID, HWND hWndCtrl ) { // What's up. switch ( nCtrlID ) { case IDC_RECORD_EDIT: ::EnableWindow( GetDlgItemHandle( IDC_RECORD_OK ), ( BOOL )( m_Key.GetWindowTextLength())); return 0; case IDC_RECORD_CANCEL: *m_pKeyString = _T( "" ); EndDialog( FALSE ); return 0; case IDC_RECORD_OK: // Copy the entered key string. m_pKeyString->GetWindowText( m_Key ); EndDialog( TRUE ); return 0; } // Pass onto the base class. return ClsDialog::OnCommand( nNotifyCode, nCtrlID, hWndCtrl ); }
// WM_INITDIALOG handler. LRESULT SyntaxPage::OnInitDialog( PROPSHEETPAGE * pPropSheetPage ) { // Setup toolbars. m_Tools.Attach( GetDlgItemHandle( IDC_TOOLS )); m_Tools.SetupToolbar( TRUE, TRUE, FALSE, FALSE ); m_Color.Attach( GetDlgItemHandle( IDC_COLOR )); m_Color.SetupToolbar( FALSE, FALSE, FALSE, TRUE ); // Setup listboxes. m_Blocks.Attach( GetDlgItemHandle( IDC_BLOCKS )); m_Common.Attach( GetDlgItemHandle( IDC_COMMON )); // And the rest of the controls. m_Escape.Attach( GetDlgItemHandle( IDC_ESCAPE )); m_Escape.SetLimitText( 1 ); m_Syntax.Attach( GetDlgItemHandle( IDC_SYNTAX )); // Call the base-class. return Page::OnInitDialog( pPropSheetPage ); }
// This overidable will be called when ClsDialog has finished // distributing the font to it's children. virtual void OnFontDistributed() { // Call the base class. ClsSizeDialog::OnFontDistributed(); // Construct the horizontal group. m_Horz[ 0 ].Attach( GetDlgItemHandle( IDC_HORZ1 )); m_Horz[ 1 ].Attach( GetDlgItemHandle( IDC_HORZ2 )); m_Horz[ 2 ].Attach( GetDlgItemHandle( IDC_HORZ3 )); AddToGroup( &m_LHorz, &m_Horz[ 0 ], RGB( 255, 0, 0 )); AddToGroup( &m_LHorz, &m_Horz[ 1 ], RGB( 255, 0, 0 )); AddToGroup( &m_LHorz, &m_Horz[ 2 ], RGB( 255, 0, 0 )); // Construct the vertical group. m_Vert[ 0 ].Attach( GetDlgItemHandle( IDC_VERT1 )); m_Vert[ 1 ].Attach( GetDlgItemHandle( IDC_VERT2 )); m_Vert[ 2 ].Attach( GetDlgItemHandle( IDC_VERT3 )); AddToGroup( &m_LVert, &m_Vert[ 0 ], RGB( 255, 255, 255 )); AddToGroup( &m_LVert, &m_Vert[ 1 ], RGB( 255, 255, 255 )); AddToGroup( &m_LVert, &m_Vert[ 2 ], RGB( 255, 255, 255 )); // Construct the grid group(s). m_Grid[ 0 ].Attach( GetDlgItemHandle( IDC_GRID1 )); m_Grid[ 1 ].Attach( GetDlgItemHandle( IDC_GRID2 )); m_Grid[ 2 ].Attach( GetDlgItemHandle( IDC_GRID3 )); m_Grid[ 3 ].Attach( GetDlgItemHandle( IDC_GRID4 )); m_Grid[ 4 ].Attach( GetDlgItemHandle( IDC_GRID5 )); m_Grid[ 5 ].Attach( GetDlgItemHandle( IDC_GRID6 )); m_Grid[ 6 ].Attach( GetDlgItemHandle( IDC_GRID7 )); m_Grid[ 7 ].Attach( GetDlgItemHandle( IDC_GRID8 )); m_Grid[ 8 ].Attach( GetDlgItemHandle( IDC_GRID9 )); AddToGroup( &m_LGrh[ 0 ], &m_Grid[ 0 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 0 ], &m_Grid[ 1 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 0 ], &m_Grid[ 2 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 1 ], &m_Grid[ 3 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 1 ], &m_Grid[ 4 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 1 ], &m_Grid[ 5 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 2 ], &m_Grid[ 6 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 2 ], &m_Grid[ 7 ], RGB( 0, 0, 255 )); AddToGroup( &m_LGrh[ 2 ], &m_Grid[ 8 ], RGB( 0, 0, 255 )); m_LGrv.AddMember( &m_LGrh[ 0 ], NULL, TAG_END ); m_LGrv.AddMember( &m_LGrh[ 1 ], NULL, TAG_END ); m_LGrv.AddMember( &m_LGrh[ 2 ], NULL, TAG_END ); // Add the horizontal, vertical and grid groups to it's parent // layout engine. m_HorVerGr.AddMember( &m_LHorz, NULL, TAG_END ); m_HorVerGr.AddMember( &m_LVert, NULL, TAG_END ); m_HorVerGr.AddMember( &m_LGrv, NULL, TAG_END ); // Construct the Weight group. m_Weight[ 0 ].Attach( GetDlgItemHandle( IDC_25 )); m_Weight[ 1 ].Attach( GetDlgItemHandle( IDC_50 )); m_Weight[ 2 ].Attach( GetDlgItemHandle( IDC_75 )); m_Weight[ 3 ].Attach( GetDlgItemHandle( IDC_100 )); AddToGroup( &m_LWeight, &m_Weight[ 0 ], RGB( 0, 255, 0 ), FALSE, 25 ); AddToGroup( &m_LWeight, &m_Weight[ 1 ], RGB( 0, 235, 0 ), FALSE, 50 ); AddToGroup( &m_LWeight, &m_Weight[ 2 ], RGB( 0, 215, 0 ), FALSE, 75 ); AddToGroup( &m_LWeight, &m_Weight[ 3 ], RGB( 0, 195, 0 ), FALSE, 100 ); // Construct the Free & Fixed group. m_FreeFixed[ 0 ].Attach( GetDlgItemHandle( IDC_FREE1 )); m_FreeFixed[ 1 ].Attach( GetDlgItemHandle( IDC_FIXED1 )); m_FreeFixed[ 2 ].Attach( GetDlgItemHandle( IDC_FREE2 )); m_FreeFixed[ 3 ].Attach( GetDlgItemHandle( IDC_FIXED2 )); AddToGroup( &m_FrFix, &m_FreeFixed[ 0 ], RGB( 220, 220, 220 )); AddToGroup( &m_FrFix, &m_FreeFixed[ 1 ], RGB( 220, 220, 220 ), TRUE ); AddToGroup( &m_FrFix, &m_FreeFixed[ 2 ], RGB( 220, 220, 220 )); AddToGroup( &m_FrFix, &m_FreeFixed[ 3 ], RGB( 220, 220, 220 ), TRUE ); // Construct the Ok button group. m_Ok.Attach( GetDlgItemHandle( IDC_OK )); m_Ok.SetHotFrame(); m_HorzOK.AddSpacingMember( 150 ); m_HorzOK.AddMember( &m_Ok, NULL, ATTR_UseControlSize, TRUE, TAG_END ); m_HorzOK.AddSpacingMember( 150 ); // Add the sub-groups to the parent group. m_Master.AddMember( &m_HorVerGr, NULL, TAG_END ); m_Master.AddMember( &m_LWeight, NULL, ATTR_FixMinHeight, TRUE, TAG_END ); m_Master.AddMember( &m_FrFix, NULL, ATTR_FixMinHeight, TRUE, TAG_END ); m_Master.AddMember( &m_HorzOK, NULL, ATTR_FixMinHeight, TRUE, TAG_END ); // Was there an error in any of the above call's? if ( m_Master.Error()) { EndDialog( 0 ); return; } // Compute the minimum size of the master group. if ( m_Master.OnGetMinSize( m_MinSize ) == FALSE ) { EndDialog( 0 ); return; } // Add frame and caption sizes so that we know the minimum // size of the dialog. m_MinSize.CY() += ( ::GetSystemMetrics( SM_CYFRAME ) * 2 ) + ::GetSystemMetrics( SM_CYCAPTION ); m_MinSize.CX() += ::GetSystemMetrics( SM_CXFRAME ) * 2; // Relayout the master layout engine control. m_Master.Relayout(); }
LRESULT KeyRec::OnInitDialog( LPPROPSHEETPAGE pPsp ) { // Setup edit control. m_Key.Attach( GetDlgItemHandle( IDC_RECORD_EDIT )); return TRUE; }
// Called after ClsDialog has distributed the dialog // font to it's children. virtual void OnFontDistributed() { // Setup static controls. Attach them to the objects and // add them to the layout engine controls. for ( int i = 0; i < 5; i++ ) { m_Statics[ i ].Attach( GetDlgItemHandle( IDC_STATIC_1 + i )); m_Left.AddSpacingMember(); m_Left.AddMember( &m_Statics[ i ], NULL, ATTR_FixMinSize, TRUE, ATTR_RightAlign, TRUE, TAG_END ); m_Left.AddSpacingMember(); } // Add the controls to the layout engine controls. m_Right.AddMember( &m_Find, NULL, TAG_END ); m_Right.AddMember( &m_Type, NULL, TAG_END ); m_Right.AddMember( &m_Folder, NULL, TAG_END ); m_Right.AddMember( &m_Proc, NULL, ATTR_UseControlSize, TRUE, TAG_END ); m_StatBut.AddMember( &m_Occ, NULL, TAG_END ); m_StatBut.AddMember( &m_About, NULL, ATTR_UseControlSize, TRUE, ATTR_FixMinWidth, TRUE, TAG_END ); m_StatBut.AddMember( &m_Go, NULL, ATTR_UseControlSize, TRUE, ATTR_FixMinWidth, TRUE, TAG_END ); m_Right.AddMember( &m_StatBut, NULL, TAG_END ); // Get the minimum size of the "m_Right" layout-engine without // the checkboxes. ClsSize szRight; m_Right.OnGetMinSize( szRight ); // Add the checkboxes. m_Right.AddMember( &m_Recur, NULL, ATTR_FixMinWidth, TRUE, TAG_END ); m_Right.AddMember( &m_Case, NULL, ATTR_FixMinWidth, TRUE, TAG_END ); // Combine left and right layout-engine controls. m_LeftRight.AddMember( &m_Left, NULL, ATTR_FixMinWidth, TRUE, ATTR_FixHeight, szRight.CY(), TAG_END ); m_LeftRight.AddMember( &m_Right, NULL, TAG_END ); // Setup the master layout engine. m_Master.AddMember( &m_LeftRight, NULL, ATTR_FixMinHeight, TRUE, TAG_END ); m_Master.AddMember( &m_List, NULL, TAG_END ); // Any errors? if ( m_Master.Error()) { // Bye... EndDialog( TRUE ); return; } // Compute the minimum size of the master group. if ( m_Master.OnGetMinSize( m_MinSize ) == FALSE ) { // Bye... EndDialog( 0 ); return; } // Add frame and caption sizes so that we know the minimum // size of the dialog. m_MinSize.CY() += ( ::GetSystemMetrics( SM_CYFRAME ) * 2 ) + ::GetSystemMetrics( SM_CYCAPTION ); m_MinSize.CX() += ::GetSystemMetrics( SM_CXFRAME ) * 2; // Relayout the master layout engine control. m_Master.Relayout(); // No thread running. m_bSearchInProgress = FALSE; // Call the base class. ClsSizeDialog::OnFontDistributed(); }