Example #1
0
    void Show() {
        TCHAR filename[MAX_PATH];
        const TCHAR *resName = NULL;
        if (!ScreenLandscape) {
            LocalPathS(filename, TEXT("dlgBluetooth_L.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH_L");
        } else {
            LocalPathS(filename, TEXT("dlgBluetooth.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH");
        }
        wfBth = dlgLoadFromXML(CallBackTable, filename, resName);
        if (wfBth) {

            WndListFrame* BthList = (WndListFrame*) wfBth->FindByName(TEXT("frmBthList"));
            if (BthList) {
                BthList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
                BthList->SetWidth(wfBth->GetWidth() - BthList->GetLeft() - IBLSCALE(4));

                // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
                // BthList->SetHeight(wfBth->GetHeight() - BthList->GetTop() - 2);
                if (BthList->ScrollbarWidth == -1) {
                    BthList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
                }

                WndOwnerDrawFrame* BthListEntry = (WndOwnerDrawFrame*) wfBth->FindByName(TEXT("frmBthListEntry"));
                if (BthListEntry) {
                    BthListEntry->SetCanFocus(true);
                    BthListEntry->SetWidth(BthList->GetWidth() - BthList->ScrollbarWidth - 5);
                }

                BthList->ResetList();
                BthList->Redraw();
            }

            if (wfBth->ShowModal()) {
                CBtHandler * pBtHandler = CBtHandler::Get();
                if (pBtHandler) {
                    pBtHandler->ClearDevices();
                    pBtHandler->FillDevices();
                }
                RefreshComPortList();
            }

            delete wfBth;
            wfBth = NULL;
        }
    }
Example #2
0
void dlgIgcFileShowModal() {
    TCHAR filename[MAX_PATH];
    const TCHAR *resName = NULL;
    if (!ScreenLandscape) {
        LocalPathS(filename, TEXT("dlgIgcFile.xml"));
        resName = TEXT("IDR_XML_IGCFILE");
    } else {
        LocalPathS(filename, TEXT("dlgIgcFile_L.xml"));
        resName = TEXT("IDR_XML_IGCFILE_L");
    }
    wfDlg = dlgLoadFromXML(DlgIgcFile::CallBackTable, filename, resName);
    if (wfDlg) {

        WndListFrame* wndFileList = (WndListFrame*) wfDlg->FindByName(TEXT("frmIgcFileList"));
        if (wndFileList) {
            wndFileList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
            wndFileList->SetWidth(wfDlg->GetWidth() - wndFileList->GetLeft() - IBLSCALE(4));

            // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
            // wndFileList->SetHeight(wfDlg->GetHeight() - wndFileList->GetTop() - 2);
            if (wndFileList->ScrollbarWidth == -1) {
                wndFileList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
            }

            WndOwnerDrawFrame* FileListEntry = (WndOwnerDrawFrame*) wfDlg->FindByName(TEXT("frmIgcFileListEntry"));
            if (FileListEntry) {
                FileListEntry->SetCanFocus(true);
                FileListEntry->SetWidth(wndFileList->GetWidth() - wndFileList->ScrollbarWidth - 5);
            }

            DlgIgcFile::ScanFile();

            wndFileList->ResetList();
            wndFileList->Redraw();
        }
    }

    if (wfDlg->ShowModal()) {

    }

    delete wfDlg;
    wfDlg = NULL;
}