LRESULT 
CContextSamplePropPage::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
    ATLTRACE( "== CContextSamplePropPage::OnInitDialog\n" );

    EnableThemeDialogTexture( m_hWnd, ETDT_ENABLETAB );

    HRESULT hr = S_OK;
    m_fInitializing = TRUE;

    hr = Connect();
    if ( FAILED( hr ) )
    {
        MessageBox( IDS_SERVER_CONNECT_ERROR );
        Deactivate();
        return( m_fInitializing = FALSE );
    }

    hr = GetPluginSetting();
    if( SUCCEEDED( hr ) )
    {
        hr = PopulateControls();
    }

    return( m_fInitializing = FALSE );
} //end of OnInitDialog.
Beispiel #2
0
void CConfigDlg::OnBnClicked(int nButton)
{
    CString szNormal;
    CString szCtrl;
    CString szShift;

    m_cNormalEdit.GetWindowText(szNormal);
    m_cCtrlEdit.GetWindowText(szCtrl);
    m_cShiftEdit.GetWindowText(szShift);

    SetupKey(m_nCurrentButton, szNormal.GetBuffer(), szCtrl.GetBuffer(), szShift.GetBuffer());

    m_nCurrentButton = nButton;

    PopulateControls();
}
Beispiel #3
0
BOOL CConfigDlg::OnInitDialog()
{
    CSizeDialog::OnInitDialog();

    m_cNormalEdit.LimitText(sizeof(m_tmpKeyMap[m_nCurrentButton].m_szNormalKey));
    m_cCtrlEdit.LimitText(sizeof(m_tmpKeyMap[m_nCurrentButton].m_szCtrlKey));
    m_cShiftEdit.LimitText(sizeof(m_tmpKeyMap[m_nCurrentButton].m_szShiftKey));

    SetupColors(&m_foreStatic, m_foreColors, true);
    SetupColors(&m_backStatic, m_backColors, false);

    GetConfig();
    RenderSample();

    PopulateControls();
    return TRUE;
}
Beispiel #4
0
void ecTemplatesDialog::CreateControls(wxWindow* parent)
{
    wxSizer *item0 = new wxBoxSizer( wxVERTICAL );

    wxStaticBox *item2 = new wxStaticBox( parent, -1, _("Hardware") );
    wxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL );

    wxString *strs3 = (wxString*) NULL;
    wxComboBox *item3 = new wxComboBox( parent, ecID_TEMPLATES_DIALOG_HARDWARE_TEMPLATES, "", wxDefaultPosition, wxSize(360,-1), 0, strs3, wxCB_DROPDOWN|wxCB_READONLY|wxCB_SORT );
    item1->Add( item3, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

    wxTextCtrl *item4 = new wxTextCtrl( parent, ecID_TEMPLATES_DIALOG_HARDWARE_DESCRIPTION, _(""), wxDefaultPosition, wxSize(90,60), wxTE_MULTILINE|wxTE_READONLY );
    item1->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

    item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

    wxSizer *item5 = new wxBoxSizer( wxHORIZONTAL );

    wxStaticBox *item7 = new wxStaticBox( parent, -1, _("Packages") );
    wxSizer *item6 = new wxStaticBoxSizer( item7, wxVERTICAL );

    wxSizer *item8 = new wxBoxSizer( wxHORIZONTAL );

    wxString *strs9 = (wxString*) NULL;
    wxChoice *item9 = new wxChoice( parent, ecID_TEMPLATES_DIALOG_PACKAGE_TEMPLATES, wxDefaultPosition, wxSize(100,-1), 0, strs9, 0 );
    item8->Add( item9, 20, wxALIGN_CENTRE|wxALL, 5 );

    wxString *strs10 = (wxString*) NULL;
    wxChoice *item10 = new wxChoice( parent, ecID_TEMPLATES_DIALOG_VERSION, wxDefaultPosition, wxSize(90,-1), 0, strs10, 0 );
    item8->Add( item10, 0, wxALIGN_CENTRE|wxALL, 5 );

    item6->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0 );

    wxTextCtrl *item11 = new wxTextCtrl( parent, ecID_TEMPLATES_DIALOG_PACKAGE_DESCRIPTION, _(""), wxDefaultPosition, wxSize(110,70), wxTE_MULTILINE|wxTE_READONLY );
    item6->Add( item11, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

    item5->Add( item6, 1, wxALIGN_CENTRE|wxLEFT|wxRIGHT|wxBOTTOM, 5 );

    wxSizer *item12 = new wxBoxSizer( wxVERTICAL );

    wxButton *item13 = new wxButton( parent, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
    item12->Add( item13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );

    wxButton *item14 = new wxButton( parent, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    item12->Add( item14, 0, wxALIGN_CENTRE|wxALL, 5 );

    item12->Add( 10, 10, 0, wxALIGN_CENTRE|wxALL, 0 );

    wxButton *item15 = new wxButton( parent, ecID_TEMPLATES_DIALOG_DETAILS, _("&Details >>"), wxDefaultPosition, wxDefaultSize, 0 );
    item12->Add( item15, 0, wxALIGN_CENTRE|wxALL, 5 );

    item5->Add( item12, 0, wxALIGN_CENTRE|wxALL, 5 );

    item0->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0 );

    wxStaticText *item16 = new wxStaticText( parent, ecID_TEMPLATES_DIALOG_PACKAGES_MSG, _("&Packages in selected template:"), wxDefaultPosition, wxDefaultSize, 0 );

    wxTextCtrl *item17 = new wxTextCtrl( parent, ecID_TEMPLATES_DIALOG_PACKAGES, _(""), wxDefaultPosition, wxSize(90,100), wxTE_MULTILINE|wxTE_READONLY );

    // Don't add these yet (until press Details)
    //item0->Add( item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    //item0->Add( item17, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    item16->Show(FALSE);
    item17->Show(FALSE);

#ifdef __WXGTK__
    wxButton *contextButton = new wxContextHelpButton( parent );
    item12->Add( contextButton, 0, wxALIGN_CENTRE|wxALL, 5 );
#endif

    parent->SetAutoLayout( TRUE );
    parent->SetSizer( item0 );
    parent->Layout();
    item0->Fit( parent );
    //item0->SetSizeHints( parent );

    // Add context-sensitive help text
    parent->FindWindow( ecID_TEMPLATES_DIALOG_HARDWARE_TEMPLATES )->SetHelpText(_("Selects from the set of available hardware templates."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_HARDWARE_DESCRIPTION )->SetHelpText(_("Gives a brief description of the currently selected hardware template."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_PACKAGE_TEMPLATES )->SetHelpText(_("Selects from the set of available package templates."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_VERSION )->SetHelpText(_("Selects the version of the currently selected template."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_PACKAGE_DESCRIPTION )->SetHelpText(_("Gives a brief description of the currently selected package template."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_PACKAGES )->SetHelpText(_("Lists the packages contained in the currently selected template."));
    parent->FindWindow( wxID_OK )->SetHelpText(_("Closes the dialog and saves any changes you have made."));
    parent->FindWindow( wxID_CANCEL )->SetHelpText(_("Closes the dialog without saving any changes you have made."));
    parent->FindWindow( ecID_TEMPLATES_DIALOG_DETAILS )->SetHelpText(_("Shows or hides a portion of the dialog that provides details of the contents of the currently selected template."));

#if __WXGTK__
    parent->FindWindow( wxID_CONTEXT_HELP )->SetHelpText(_("Invokes context-sensitive help for the clicked-on window."));
#endif

	// Add validators
	parent->FindWindow( ecID_TEMPLATES_DIALOG_PACKAGE_DESCRIPTION )->SetValidator(wxGenericValidator(& m_strCdlTemplateDescription));
	parent->FindWindow( ecID_TEMPLATES_DIALOG_HARDWARE_DESCRIPTION )->SetValidator(wxGenericValidator(& m_strCdlHardwareDescription));
	parent->FindWindow( ecID_TEMPLATES_DIALOG_PACKAGES)->SetValidator(wxGenericValidator(& m_strCdlTemplatePackages));

    PopulateControls();
}
Beispiel #5
0
void CConfigDlg::OnBnClickedDefaults()
{
    DefaultKeys();
    PopulateControls();
}