Exemplo n.º 1
0
//-------------------------------------------------------------------------
DWINFO *InfoPad::CreateDrawWindow(DWINFO *baseinfo, int visible)
{
    int i;
    static DWINFO temp;

    newInfo = baseinfo;
    if (!newInfo || newInfo == (DWINFO *)-1)
    {
        newInfo = &temp;
        newInfo->dwLineNo =  - 1;
        newInfo->logMRU = TRUE;
        newInfo->newFile = newInfo == (DWINFO *)-1;
        fileDlg = new TFileDialog( "*.*", newInfo->newFile ? "Create new file" : "Open File", "", fdOKButton, 0);
        char buf[512];
        buf[0] = 0;
        if (executeDialog(fileDlg,buf) == cmFileOpen)
        {
            fileDlg = NULL;
            char *q = strrchr(buf, '\\');
            if (q)
                q++;
            else
                q = buf;
            strcpy(newInfo->dwTitle, q);
            strcpy(newInfo->dwName, buf);
            openfile(newInfo, FALSE, True);
        }
    }
    else
    {
        openfile(newInfo, FALSE, visible);
    }
}
Exemplo n.º 2
0
void TMyApp::aboutDlgBox() {
    TDialog *aboutBox = new TDialog(TRect(0, 0, 39, 13), "About");

    aboutBox->insert(new TStaticText(TRect(9, 2, 30, 9), "\003Turbo Vision Demo\n\n" // These strings will be
                    "\003C++ Version\n\n"// concatenated by the compiler.
                    "\003Copyright (c) 2012\n\n"// The \003 centers the line.
                    "\003Borland International"));

    aboutBox->insert(new TButton(TRect(14, 10, 26, 12), " OK", cmOK, bfDefault));

    aboutBox->options |= ofCentered;

    executeDialog(aboutBox);
}