Sub Menu
Suche

Last Online
In order to view the online list you have to be registered and logged in.



We are a free and open
community, all are welcome.

Click here to Register

Injection to other options pages

BeitragAuthor: taz » Sa 28. Jun 2008, 16:40

Hi,

In the merge project I'm working on, there was a room for same checkbox on 2 option pages. Since I invested some time in this I thought a code sample that might be useful for others is in place.

@CPPgSecurity::OnApply
Code: Alles auswählen
...
    if (!thePrefs.filterserverbyip && IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0)
        bIPFilterSettingsChanged = true;

// By Taz - sync with IDC_FILTERSERVERBYIPFILTER on PPgMOD2
//    thePrefs.filterserverbyip = IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0;
    if (::IsWindowVisible(m_hWnd)){
        thePrefs.filterserverbyip = (IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER)!=0);
        if(thePrefs.filterserverbyip)
            theApp.emuledlg->preferenceswnd->m_wndMOD2.CheckDlgButton(IDC_FILTERSERVERBYIPFILTER, 1);
        else
            theApp.emuledlg->preferenceswnd->m_wndMOD2.CheckDlgButton(IDC_FILTERSERVERBYIPFILTER, 0);
    }
    else if (!::IsWindowVisible(theApp.emuledlg->preferenceswnd->m_wndMOD2.m_hWnd) &&
            (IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER) != theApp.emuledlg->preferenceswnd->m_wndMOD2.IsDlgButtonChecked(IDC_FILTERSERVERBYIPFILTER))){
// revert to default value
                CheckDlgButton(IDC_FILTERSERVERBYIPFILTER, 1);
                thePrefs.filterserverbyip = true;
    }
// <------- sync with IDC_FILTERSERVERBYIPFILTER on PPgMOD2

    if (bIPFilterSettingsChanged)
        theApp.emuledlg->serverwnd->serverlistctrl.RemoveAllFilteredServers();
...


and a small change @PreferencesDlg.h

Code: Alles auswählen
// Contrib - SlideBar
//class CPreferencesDlg : public CTreePropSheet
class CPreferencesDlg : public PREF_PARENT_CLASS
// <-------- SlideBar

{

// By Taz - ASF
    friend class CPPgMOD2;
    friend class CPPgSecurity;
// <------- ASF

    DECLARE_DYNAMIC(CPreferencesDlg)

public:
...


Bild
SharkX modder - less " free meals" only a CLICK away !
Requests for additional / changed features HERE Next version changelog
Benutzeravatar
taz
Stammgast
 
Beiträge: 438
Registriert: Do 29. Mär 2007, 07:30
Wohnort: Israel

Zurück zu Entwicklung

Wer ist online?

Mitglieder: 0 Mitglieder

cron