Esempio n. 1
0
/// HandleInput_Main_Win
BOOL HandleInput_Main_Win(void)
{
    uint32 result      = 0;
    uint16 code        = 0;
    BOOL   done        = FALSE;

    while ((result = RA_HandleInput(win, &code)))
    {
        switch(result & WMHI_CLASSMASK)
        {
            case WMHI_CLOSEWINDOW:
                done = TRUE;
                break;
            case WMHI_GADGETUP:
                switch (result & WMHI_GADGETMASK)
                {
                    case OBJ_LBROWSER_BROW:
                    {
                        uint32 retval = iget(OBJ(OBJ_LBROWSER_BROW), LISTBROWSER_RelEvent);

                        switch(retval)
                        {
                            case LBRE_CHECKED:
                            case LBRE_UNCHECKED:
                            {
                                struct URL_BrowserNode *bn;

                                bn = (struct URL_BrowserNode *)iget(OBJ(OBJ_LBROWSER_BROW), LISTBROWSER_SelectedNode);
                                if (retval == LBRE_UNCHECKED)
                                    SET_FLAG(bn->ubn_Flags,UNF_DISABLED);
                                else
                                    CLEAR_FLAG(bn->ubn_Flags,UNF_DISABLED);
                            }
                        }
                        if (retval != LBRE_DOUBLECLICK)break;
                        // we deliberately go on executing following case OBJ_EDIT_BROW
                        // because a double click mean the same as clicking edit button
                    }
                    case OBJ_EDIT_BROW:
                    {
                        struct URL_BrowserNode *bn;

                        bn = (struct URL_BrowserNode *)iget(OBJ(OBJ_LBROWSER_BROW), LISTBROWSER_SelectedNode);
                        updateBrowserWindow(bn);
                        edit_brow_window = RA_OpenWindow(edit_brow_win);
                        break;
                    }
                    case OBJ_LBROWSER_MAIL:
                    {
                        uint32 retval = iget(OBJ(OBJ_LBROWSER_MAIL), LISTBROWSER_RelEvent);

                        switch(retval)
                        {
                            case LBRE_CHECKED:
                            case LBRE_UNCHECKED:
                            {
                                struct URL_MailerNode *mn;

                                mn = (struct URL_MailerNode *)iget(OBJ(OBJ_LBROWSER_MAIL), LISTBROWSER_SelectedNode);
                                if (retval == LBRE_UNCHECKED)
                                    SET_FLAG(mn->umn_Flags,UNF_DISABLED);
                                else
                                    CLEAR_FLAG(mn->umn_Flags,UNF_DISABLED);
                            }
                        }
                        if (retval != LBRE_DOUBLECLICK) break;
                        // we deliberately go on executing following case OBJ_EDIT_MAIL
                        // because a double click mean the same as clicking edit button
                    }
                    case OBJ_EDIT_MAIL:
                    {
                        struct URL_MailerNode *mn;

                        mn = (struct URL_MailerNode *)iget(OBJ(OBJ_LBROWSER_MAIL), LISTBROWSER_SelectedNode);
                        updateMailerWindow(mn);
                        edit_mail_window = RA_OpenWindow(edit_mail_win);
                        break;
                    }
                    case OBJ_LBROWSER_FTP:
                    {
                        uint32 retval = iget(OBJ(OBJ_LBROWSER_FTP), LISTBROWSER_RelEvent);

                        switch(retval)
                        {
                            case LBRE_CHECKED:
                            case LBRE_UNCHECKED:
                            {
                                struct URL_FTPNode *fn;

                                fn = (struct URL_FTPNode *)iget(OBJ(OBJ_LBROWSER_FTP), LISTBROWSER_SelectedNode);
                                if (retval == LBRE_UNCHECKED)
                                    SET_FLAG(fn->ufn_Flags,UNF_DISABLED);
                                else
                                    CLEAR_FLAG(fn->ufn_Flags,UNF_DISABLED);
                            }
                        }
                        if (retval != LBRE_DOUBLECLICK) break;
                        // we deliberately go on executing following case OBJ_EDIT_FTP
                        //  because a double click mean the same as clicking edit button
                    }
                    case OBJ_EDIT_FTP:
                    {
                        struct URL_FTPNode *fn;

                        fn = (struct URL_FTPNode *)iget(OBJ(OBJ_LBROWSER_FTP), LISTBROWSER_SelectedNode);
                        updateFTPWindow(fn);
                        edit_ftp_window = RA_OpenWindow(edit_ftp_win);
                        break;
                    }
                    case OBJ_USE:
                    case OBJ_SAVE:
                    case OBJ_APPLY:
                        storePrefs((result & WMHI_GADGETMASK)==OBJ_SAVE);
                        if((result & WMHI_GADGETMASK)!=OBJ_APPLY)
                            done=TRUE;
                        break;
                    case OBJ_CANCEL:
                        done=TRUE;
                        break;
                }
                break;
            case WMHI_ICONIFY:
                if (RA_Iconify(win))
                {
                    window = NULL;
                    if (edit_brow_window)
                    {
                        RA_CloseWindow(edit_brow_win);
                        edit_brow_window = NULL;
                    }
                    if (edit_mail_window)
                    {
                        RA_CloseWindow(edit_mail_win);
                        edit_mail_window = NULL;
                    }
                    if (edit_ftp_window)
                    {
                        RA_CloseWindow(edit_ftp_win);
                        edit_ftp_window = NULL;
                    }
                }
                break;
            case WMHI_UNICONIFY:
                window = RA_OpenWindow(win);
                break;
        }
    }
    return (done);
}
Esempio n. 2
0
void MickeyGUI::closeEvent(QCloseEvent *event)
{
  storePrefs();
  HelpViewer::CloseWindow();
  QWidget::closeEvent(event);
}