static int GoBackCallback( vlc_object_t *p_this, char const *psz_var, vlc_value_t oldval, vlc_value_t newval, void *p_data ) { intf_thread_t *p_intf = (intf_thread_t *) p_data; GoBack( p_intf ); return VLC_SUCCESS; }
void GSSpiral::Update() { static Timer* timer = TheTimer::Instance(); m_timer += timer->GetDt(); if (m_timer > 10.5f) { GoBack(); } }
void testM(HashMaps **head) { GoBack(head); while ((*head)->next != NULL) { void *test = (*head)->value; struct _test *toto = (struct _test *)test; printf("index = %d\n column = %s\n test = %s\n", (*head)->index, toto->column, toto->test); (*head) = (*head)->next; } }
bool IfKeyExist(char *key, HashMaps *head) { GoBack(&head); while(head->next != NULL) { if (strcmp(key, head->key) == 0) { GoFront(&head); return true; } head = head->next; } return (false); }
void dskHostGame::Msg_MsgBoxResult(const unsigned msgbox_id, const MsgboxResult mbr) { switch(msgbox_id) { case 0: // Verbindung zu Server verloren? { GAMECLIENT.Stop(); GoBack(); } break; case CGI_ADDONS: // addon-window applied settings? { if(mbr == MSR_YES) UpdateGGS(); } break; } }
void GSAvatarMod::OnOk() { PlayerInfo* pi = ThePlayerInfoManager::Instance()->GetPI(); // pi->PISetBool(PI_KEY("has set up"), true); // This may not be necessary except as an optimisation and so we display the correct type next time // we are in this game state...? // TODO Not using this info yet // pi->PISetInt(PI_KEY("avatar"), m_currentChar); // Send update req so all clients show correct avatar settings int objId = pi->PIGetInt(PI_KEY("player obj id")); // OR GetLocalPlayer()->GetId() -- which is better ? TheObjectUpdater::Instance()->SendUpdateReq(objId, SET_KEY("avatar"), m_currentChar); // TODO more avatar settings GoBack(); }
void dskSelectMap::Msg_ButtonClick(const unsigned int ctrl_id) { switch(ctrl_id) { case 3: // "Zurück" { GoBack(); } break; case 4: // "Spiel laden..." { // Ladefenster aufrufen WINDOWMANAGER.Show(new iwLoad(csi)); } break; case 5: // "Weiter" { StartServer(); } break; } }
FReply FCEFWebBrowserWindow::OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent, bool bIsPopup) { FReply Reply = FReply::Unhandled(); if (IsValid()) { FKey Button = MouseEvent.GetEffectingButton(); // CEF only supports left, right, and middle mouse buttons bool bIsCefSupportedButton = (Button == EKeys::LeftMouseButton || Button == EKeys::RightMouseButton || Button == EKeys::MiddleMouseButton); if(bIsCefSupportedButton) { CefBrowserHost::MouseButtonType Type = (Button == EKeys::LeftMouseButton ? MBT_LEFT : ( Button == EKeys::RightMouseButton ? MBT_RIGHT : MBT_MIDDLE)); CefMouseEvent Event = GetCefMouseEvent(MyGeometry, MouseEvent, bIsPopup); InternalCefBrowser->GetHost()->SendMouseClickEvent(Event, Type, true, 1); Reply = FReply::Handled(); } else if(Button == EKeys::ThumbMouseButton && bThumbMouseButtonNavigation) { if(CanGoBack()) { GoBack(); Reply = FReply::Handled(); } } else if(Button == EKeys::ThumbMouseButton2 && bThumbMouseButtonNavigation) { if(CanGoForward()) { GoForward(); Reply = FReply::Handled(); } } } return Reply; }
void CReplayBrowserBasePage::OnCommand( const char *pCommand ) { // User wants details on a replay? if ( !V_strnicmp( pCommand, "details", 7 ) ) { // Get rid of preview panel m_pReplayList->ClearPreviewPanel(); QueryableReplayItemHandle_t hReplayItem = (QueryableReplayItemHandle_t)atoi( pCommand + 7 ); IReplayItemManager *pItemManager; IQueryableReplayItem *pReplayItem = FindReplayItem( hReplayItem, &pItemManager ); Assert( pReplayItem ); if ( pReplayItem ) { // Get performance int iPerformance = -1; const char *pPerformanceStr = V_strstr( pCommand + 8, "_" ); if ( pPerformanceStr ) { iPerformance = atoi( pPerformanceStr + 1 ); } m_hReplayDetailsPanel = vgui::SETUP_PANEL( new CReplayDetailsPanel( this, hReplayItem, iPerformance, pItemManager ) ); m_hReplayDetailsPanel->SetVisible( true ); m_hReplayDetailsPanel->MoveToFront(); m_pReplayList->SetVisible( false ); surface()->PlaySound( "replay\\showdetails.wav" ); } } // "back" button was hit in details panel? else if ( FStrEq( pCommand, "back" ) ) { GoBack(); } BaseClass::OnCommand( pCommand ); }
/// Startet das Spiel mit einer bestimmten Auswahl in der Tabelle void dskSelectMap::StartServer() { ctrlTable* table = GetCtrl<ctrlTable>(1); unsigned short selection = table->GetSelection(); // Ist die Auswahl gültig? if(selection < table->GetRowCount()) { // Kartenpfad aus Tabelle holen map_path = table->GetItemText(selection, 5); // Server starten if(!GAMESERVER.TryToStart(csi, map_path, MAPTYPE_OLDMAP)) { GoBack(); } else { // Verbindungsfenster anzeigen WINDOWMANAGER.Show(new iwPleaseWait); } } }
// these are all simple one-liners to do simple controlling of the browser void CMfcieView::OnGoBack() { GoBack(); }
void CWebView::OnGoBack() { GoBack(); }
void BhvGoalie::Execute(){ // bhvDrible.Execute(); // SetHeadMode(HEAD_TRACK); // return; if(savingflag){ SaveMotion(); return; } /* if(GaitMaker::IsStop()){ int x,y; scanf("%d",&x); scanf("%d",&y); int walk = dpmla.get_action(x,y,0); printf("%d\n",walk); SetPresetWalk(walk); } */ /* SetHeadMode(HEAD_TRACK_KP); Saving(); return; */ if(mode != RETURN_GOALMOUTH) gmcnt = 0; switch(mode){ case GO_BACK: GoBack(); break; case RETURN_GOALAREA: SetFaceLED(FACE_ONE); SetTailMode(TAIL_STOP); ReturnToGoalArea(); break; case ADJUST_POSITION: SetFaceLED(FACE_TWO); SetTailMode(TAIL_ANGRY); AdjustPosition(); break; case WAIT: SetFaceLED(FACE_THREE); SetTailMode(TAIL_SWING); Wait(); break; case CHASE: SetFaceLED(FACE_FOUR); // OSYSPRINT(("%.1f\n",state.ball.distance)); ChaseBall(); SetTailMode(TAIL_ANGRY); break; case CLEAR: SetFaceLED(FACE_FIVE); Clear(); SetTailMode(TAIL_STOP); break; case RETURN_GOALMOUTH: ReturnGoalMouth(); break; } }
void dskHostGame::Msg_ButtonClick(const unsigned int ctrl_id) { switch(ctrl_id) { case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 80: //swap { LOG.lprintf("dskHostGame: swap button pressed\n"); unsigned char p = 0; while (true) { if (GAMECLIENT.GetPlayer(p).is_host) { LOG.lprintf("dskHostGame: host detected\n"); break; } if(p > MAX_PLAYERS) { LOG.lprintf("dskHostGame: could not find host\n"); break; } else p++; } if (p < MAX_PLAYERS) { GAMESERVER.SwapPlayer(p, ctrl_id - 81); CI_PlayersSwapped(p, ctrl_id - 81); } } break; case 3: // Zurück { if(GAMECLIENT.IsHost()) GAMESERVER.Stop(); GAMECLIENT.Stop(); GoBack(); } break; case 2: // Starten { ctrlTextButton* ready = GetCtrl<ctrlTextButton>(2); if(GAMECLIENT.IsHost()) { if(lua) lua->EventPlayerReady(GAMECLIENT.GetPlayerID()); if(ready->GetText() == _("Start game")) { if(GAMESERVER.StartCountdown()) { ready->SetText(_("Cancel start")); } else WINDOWMANAGER.Show(new iwMsgbox(_("Error"), _("Game can only be started as soon as everybody has a unique color,everyone is ready and all free slots are closed."), this, MSB_OK, MSB_EXCLAMATIONRED, 10)); } else GAMESERVER.CancelCountdown(); } else { if(ready->GetText() == _("Ready")) TogglePlayerReady(GAMECLIENT.GetPlayerID(), true); else TogglePlayerReady(GAMECLIENT.GetPlayerID(), false); } } break; case 22: // Addons { iwAddons* w; if(allowAddonChange && (!lua || lua->IsChangeAllowed("addonsAll"))) w = new iwAddons(ggs_, iwAddons::HOSTGAME); else if(allowAddonChange) w = new iwAddons(ggs_, iwAddons::HOSTGAME_WHITELIST, lua->GetAllowedAddons()); else w = new iwAddons(ggs_, iwAddons::READONLY); w->SetParent(this); WINDOWMANAGER.Show(w); } break; } }
int Dungeon::Reaction() { if (!menuflag) { //マップの踏破 if (!(savedata->map_open_flag[floors - 1][pos_z][pos_x])) { savedata->map_open_flag[floors - 1][pos_z][pos_x] = 1; } if (!state) { if (Key_Input::buff_time[KEY_INPUT_LEFT]) //stateで管理しているため%X==1が必要ない { player->addWalkCount(1); state = 4; } else if (Key_Input::buff_time[KEY_INPUT_RIGHT]) { player->addWalkCount(1); state = 2; } else if (Key_Input::buff_time[KEY_INPUT_DOWN]) { player->addWalkCount(1); state = 3; } else if (Key_Input::buff_time[KEY_INPUT_A]) { for (int i = 0; !i; i++) //隣が壁なら移動しない { if (muki == 0 && (map_data[pos_z][pos_x] & 8)) { break; } if (muki == 1 && (map_data[pos_z][pos_x] & 1)) { break; } if (muki == 2 && (map_data[pos_z][pos_x] & 2)) { break; } if (muki == 3 && (map_data[pos_z][pos_x] & 4)) { break; } state = 6; } } else if (Key_Input::buff_time[KEY_INPUT_D]) { for (int i = 0; !i; i++) //隣が壁なら移動しない { if (muki == 0 && (map_data[pos_z][pos_x] & 2)) { break; } if (muki == 1 && (map_data[pos_z][pos_x] & 4)) { break; } if (muki == 2 && (map_data[pos_z][pos_x] & 8)) { break; } if (muki == 3 && (map_data[pos_z][pos_x] & 1)) { break; } state = 5; } } else if (Key_Input::buff_time[KEY_INPUT_UP]) { player->addWalkCount(1); for (int i = 0; !i; i++) { if (muki == 0 && (map_data[pos_z][pos_x] & 1)) { break; } if (muki == 1 && (map_data[pos_z][pos_x] & 2)) { break; } if (muki == 2 && (map_data[pos_z][pos_x] & 4)) { break; } if (muki == 3 && (map_data[pos_z][pos_x] & 8)) { break; } state = 1; } } else if (Key_Input::buff_time[KEY_INPUT_X] == 1) { menuflag = 1; //minimap_flag = !minimap_flag; //現状は表示/非表示のみ } } if (state) { switch (state) { case 1: //前進 GoForward(); break; //右転回 case 2: if (time < 50) { time += option->revolve_speed; Return_right(); } else { time = 0; state = 0; revflag++; } break; case 3: //下向き。2倍速で2回右転回 ReturnBack(); break; //左転回 case 4: ReturnLeft(); break; //Dボタン押し下時 case 5: GoRight(); break; //Aボタン押し下時 case 6: GoLeft(); break; //後退 case 8: GoBack(); break; default: break; } //歩き終わった場合のチェック if (!state) { if (!revflag) { state = 0; } else { revflag = 0; } } } } else { menu->Reaction(); } return 0; }
MainUI::MainUI(bool debugmode, QString fileURL, QString title, QString iconpath) : QMainWindow(){ //Setup UI DEBUG = debugmode; baseURL = fileURL; AUTHCOMPLETE = false; //not performed yet if(title.isEmpty()){ if(baseURL.contains("://")){ this->setWindowTitle(baseURL); }else{ this->setWindowTitle(baseURL.section("/",-1)); } }else{ this->setWindowTitle(title); } this->resize(1024,600); //Check the given icon QIcon ico; if(!iconpath.isEmpty()){ //qDebug() << "Checking icon:" << iconpath; if(iconpath.startsWith("/") && QFile::exists(iconpath)){ico = QIcon(iconpath); } else if( QFile::exists("/usr/local/share/pixmaps/"+iconpath)){ ico = QIcon("/usr/local/share/pixmaps/"+iconpath); } else if( QFile::exists("/usr/local/share/pixmaps/"+iconpath+".png")){ ico = QIcon("/usr/local/share/pixmaps/"+iconpath+".png"); } else{ ico = QIcon::fromTheme(iconpath); } } if(ico.isNull()){ico = QIcon(":icons/webview.png"); } this->setWindowIcon( ico); if(this->centralWidget()==0){ this->setCentralWidget( new QWidget(this) ); } this->centralWidget()->setLayout( new QVBoxLayout() ); this->centralWidget()->layout()->setContentsMargins(0,0,0,0); this->setStatusBar(new QStatusBar()); //Setup the ToolBar QToolBar *tb = this->addToolBar(""); tb->setMovable(false); tb->setFloatable(false); backA = tb->addAction(QIcon(":icons/back.png"), tr("Back"), this, SLOT(GoBack()) ); forA = tb->addAction(QIcon(":icons/forward.png"), tr("Forward"), this, SLOT(GoForward()) ); refA = tb->addAction(QIcon(":icons/refresh.png"), tr("Refresh"), this, SLOT(GoRefresh()) ); stopA = tb->addAction(QIcon(":icons/stop.png"), tr("Stop"), this, SLOT(GoStop()) ); // - toolbar spacer QWidget *spacer = new QWidget(this); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tb->addWidget(spacer); // - Progress bar progressBar = new QProgressBar(this); progressBar->setRange(0,100); progA = tb->addWidget(progressBar); //add it to the end of the toolbar progA->setVisible(false); //start off invisible //Setup the search options group_search = new QFrame(this); group_search->setLayout( new QHBoxLayout() ); group_search->layout()->setContentsMargins(2,2,2,2); line_search = new QLineEdit(this); group_search->layout()->addWidget(line_search); tool_search = new QToolButton(this); group_search->layout()->addWidget(tool_search); tool_search->setIcon( QIcon(":icons/search.png") ); group_search->layout()->addItem(new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Minimum) ); //Setup the Main Interface webview = new QWebView(this); this->centralWidget()->layout()->addWidget(webview); if(webview->page()==0){ webview->setPage(new QWebPage(webview)); } webview->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); this->centralWidget()->layout()->addWidget(group_search); //Make sure the search bar is hidden to start with group_search->setVisible(false); //Create the special keyboard shortcuts QKeySequence key(QKeySequence::Find); ctrlF = new QShortcut( key, this ); key = QKeySequence(Qt::Key_Escape); esc = new QShortcut( key, this ); //Connect signals/slots connect(webview, SIGNAL(linkClicked(const QUrl&)), this, SLOT(LinkClicked(const QUrl&)) ); connect(webview, SIGNAL(urlChanged(const QUrl&)), this, SLOT(LinkClicked(const QUrl&)) ); connect(webview, SIGNAL(loadStarted()), this, SLOT(PageStartLoading()) ); connect(webview, SIGNAL(loadProgress(int)), this, SLOT(PageLoadProgress(int)) ); connect(webview, SIGNAL(loadFinished(bool)), this, SLOT(PageDoneLoading(bool)) ); connect(webview->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT( authenticate(QNetworkReply*) ) ); connect(tool_search, SIGNAL(clicked()), this, SLOT(GoSearch()) ); connect(line_search, SIGNAL(returnPressed()), this, SLOT(GoSearch()) ); connect(ctrlF, SIGNAL(activated()), this, SLOT(openSearch()) ); connect(esc, SIGNAL(activated()), this, SLOT(closeSearch()) ); if(DEBUG){ //connect(webview, SIGNAL(statusBarMessage(const QString&)), this, SLOT(StatusTextChanged(const QString&)) ); connect(webview->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SLOT(StatusTextChanged(const QString&)) ); } this->statusBar()->setVisible(DEBUG); loadHomePage(); webview->show(); }
void CReplayBrowserBasePage::OnReplayItemDeleted( KeyValues *pParams ) { GoBack(); }
void CSPDReaderView::OnViewBack(wxCommandEvent &evt) { GoBack(); }
/***************************************************************************** * RunIntf: main loop *****************************************************************************/ static void RunIntf( intf_thread_t *p_intf ) { vout_thread_t * p_vout = NULL; if( InitThread( p_intf ) < 0 ) { msg_Err( p_intf, "can't initialize CMML interface" ); return; } #ifdef CMML_INTF_DEBUG msg_Dbg( p_intf, "CMML intf initialized" ); #endif /* if video output is dying, disassociate ourselves from it */ if( p_vout && p_vout->b_die ) { var_DelCallback( p_vout, "mouse-clicked", MouseEvent, p_intf ); vlc_object_release( p_vout ); p_vout = NULL; } /* Main loop */ while( !p_intf->b_die ) { /* find a video output if we currently don't have one */ if( p_vout == NULL ) { p_vout = vlc_object_find( p_intf->p_sys->p_input, VLC_OBJECT_VOUT, FIND_CHILD ); if( p_vout ) { #ifdef CMML_INTF_DEBUG msg_Dbg( p_intf, "found vout thread" ); #endif var_AddCallback( p_vout, "mouse-clicked", MouseEvent, p_intf ); } } vlc_mutex_lock( &p_intf->change_lock ); /* * keyboard event */ if( p_intf->p_sys->b_key_pressed ) { vlc_value_t val; int i, i_action = -1; struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys; /* Find action triggered by hotkey (if any) */ var_Get( p_intf->p_vlc, "key-pressed", &val ); /* Acknowledge that we've handled the b_key_pressed event */ p_intf->p_sys->b_key_pressed = VLC_FALSE; #ifdef CMML_INTF_DEBUG msg_Dbg( p_intf, "Got a keypress: %d", val.i_int ); #endif for( i = 0; p_hotkeys[i].psz_action != NULL; i++ ) { if( p_hotkeys[i].i_key == val.i_int ) i_action = p_hotkeys[i].i_action; } /* What did the user do? */ if( i_action != -1 ) { switch( i_action ) { case ACTIONID_NAV_ACTIVATE: FollowAnchor( p_intf ); break; case ACTIONID_HISTORY_BACK: GoBack( p_intf ); break; case ACTIONID_HISTORY_FORWARD: GoForward( p_intf ); break; default: break; } } } vlc_mutex_unlock( &p_intf->change_lock ); (void) DisplayPendingAnchor( p_intf, p_vout ); /* Wait a bit */ msleep( INTF_IDLE_SLEEP ); } /* if we're here, the video output is dying: release the vout object */ if( p_vout ) { var_DelCallback( p_vout, "mouse-clicked", MouseEvent, p_intf ); vlc_object_release( p_vout ); } vlc_object_release( p_intf->p_sys->p_input ); }
//---------------------------------------------------------------------------- //! \brief handle key input function for any GUI's, include correction key(nChar == 8) //---------------------------------------------------------------------------- void CReturnDlg::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { Beep1(); switch(m_iLevel) { case PASSWORD_INPUT: //Password Input m_strMsg2.SetCaption(DealPassword(nChar, m_strPassword)); break; case AMOUNT_INPUT: //Amout Input case DEBITCASHBACK: //CASHBACK case CHIP_DEBITCASHBACK: //CASHBACK m_strMsg2.SetCaption(DealAmount(nChar, m_strMsg2.m_szCaption)); break; case CLERK_INPUT: //Clerk ID input m_strMsg2.SetCaption(DealClerkID(nChar, m_strMsg2.m_szCaption)); break; case RECEIP_TINPUT: //Receipt input m_strMsg2.SetCaption(DealReceipt(nChar, m_strMsg2.m_szCaption)); break; case ENTERCARD_INPUT: //Card enter and manual Entry KillTimer(1); m_strMsg2.SetCaption(KeyAccount(nChar, m_strMsg2.m_szCaption)); if (m_KeyEntry) m_strMsg2.m_nFormat = DT_RIGHT; SetTimer(1, 30000, NULL); break; case DEBITTIPSELECT: //TipSelect case CHIP_DEBITTIPSELECT: //TipSelect if (nChar == 8) GoBack(); break; case DEBITSURCHARGEFEE: //surcharge fee case DEBITSELECTACCOUNT: // SelectAccount case CHIP_DEBITSURCHARGEFEE: //surcharge fee case CHIP_DEBITSELECTACCOUNT: // SelectAccount if (nChar == '1') OnBnClickedButton(IDC_BUTTON1); if (nChar == '3') OnBnClickedButton(IDC_BUTTON2); if (nChar == 8) GoBack(); break; case DEBITMERCHANTCOPY: // for merchant copy of the receipt case CHIP_DEBITMERCHANTCOPY: // for merchant copy of the receipt return; case DEBITCUSTOMERCOPY: // for Customer copy of the receipt if (nChar == 8) { KillTimer(1); CDialog::OnCancel(); } break; case DEBITWAITCOPYEND: // waiting for Customer copy of the receipt ending... case CHIP_DEBITWAITCOPYEND: // waiting for Customer copy of the receipt ending... break; // == == == == == == == == == == == == == = EMV Chip Card Debit Sale :C chip page 122 == == == == == == == == == == == == == = case SELECT_LANGUAGE: //select language case SELECT_APPLICATIION: //select application case APPLICATION_CONFIRM: //select comfirm if (nChar == '1') OnBnClickedButton(IDC_BUTTON1); if (nChar == '3') OnBnClickedButton(IDC_BUTTON2); break; case CHIP_DEBITCUSTOMERCOPY: // for Customer copy of the receipt if (nChar == 8) { KillTimer(1); GoToLevel(CHIP_DEBITEND); } break; // == == == == == == == == == == == == == = Credit Card Sale :C Swiped page 75 == == == == == == == == == == == == == == == == == = case CREDITSWIPEENTRYY: m_strMsg2.SetCaption(DealFraud(nChar, m_strMsg2.m_szCaption)); break; case CREDITSWIPETOCUSTOMER: // for Customer copy of the receipt if (nChar == 8) { KillTimer(1); GoBack(); } break; case CREDITSWIPETIPSELECT: //TipSelect if (nChar == 8) GoBack(); break; case CREDITMERCHANTCOPY: // for merchant copy of the receipt return; case CREDITCUSTOMERCOPY: // for Customer copy of the receipt if (nChar == 8) { KillTimer(1); CDialog::OnCancel(); } break; // == == == == == == == == == == == == == = Credit Card Sale :C Manual Entry :C Swiped page 79 == == == == == == == == == == == == == == == == == = case MANUALENTRYY: m_strMsg2.SetCaption(KeyExpiry(nChar, m_strMsg2.m_szCaption)); break; case MANUAL_IMPRINT_CARD: // for Customer copy of the receipt case MANUAL_SWIPETOCUSTOMER: // for Customer copy of the receipt if (nChar == 8) { KillTimer(1); GoBack(); } break; case MANUAL_SWIPETIPSELECT: //TipSelect if (nChar == 8) GoBack(); break; // == == == == == == == Display Window == == == == == case DISPLAY_WINDOW: if (nChar == 8) { if (CDisplay::GetMask() & MASK_CORR) CDisplay::SetKeyReturn(KEY_CORR); } break; case EMV_SELECT_LANGUAGE: //EMV Select language case EMV_SELECT_ACCOUNT: //EMV select account if (nChar == '1') OnBnClickedButton(IDC_BUTTON1); if (nChar == '3') OnBnClickedButton(IDC_BUTTON2); if (nChar == 8) SetKeyReturn(KEY_CORR); break; case EMV_CONFIRM_AMOUNT: //EMV confirm amount if (nChar == 8) SetKeyReturn(KEY_CORR); break; // == == == == == == == == == == == == = End == == == == == == == == == == == == == == == = } SetFocus(); }
MainUI::MainUI(bool debugmode) : QMainWindow(){ //Setup UI DEBUG = debugmode; AUTHCOMPLETE = false; //not performed yet this->setWindowTitle(tr("AppCafe")); //Need 1024 wide if possible this->resize(1024,600); this->setWindowIcon( QIcon(":icons/appcafe.png") ); if(this->centralWidget()==0){ this->setCentralWidget( new QWidget(this) ); } this->centralWidget()->setLayout( new QVBoxLayout() ); this->centralWidget()->layout()->setContentsMargins(0,0,0,0); this->setStatusBar(new QStatusBar()); //Setup the ToolBar QToolBar *tb = this->addToolBar(""); tb->setMovable(false); tb->setFloatable(false); tb->setContextMenuPolicy(Qt::CustomContextMenu); //disable the built-in visibility context menu backA = tb->addAction(QIcon(":icons/back.png"), tr("Back"), this, SLOT(GoBack()) ); forA = tb->addAction(QIcon(":icons/forward.png"), tr("Forward"), this, SLOT(GoForward()) ); refA = tb->addAction(QIcon(":icons/refresh.png"), tr("Refresh"), this, SLOT(GoRefresh()) ); stopA = tb->addAction(QIcon(":icons/stop.png"), tr("Stop"), this, SLOT(GoStop()) ); // - toolbar spacer QWidget *spacer = new QWidget(this); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tb->addWidget(spacer); // - Progress bar progressBar = new QProgressBar(this); progressBar->setRange(0,100); progA = tb->addWidget(progressBar); //add it to the end of the toolbar progA->setVisible(false); //start off invisible // - List Button listB = new QToolButton(this); listB->setIcon( QIcon(":icons/list.png") ); listB->setToolTip( tr("AppCafe Options") ); listB->setStyleSheet( "QToolButton::menu-indicator{ image: none; }" ); listB->setPopupMode(QToolButton::InstantPopup); tb->addWidget(listB); //Setup the menu for this button listMenu = new QMenu(); listMenu->addAction(QIcon(":icons/configure.png"), tr("Configure"), this, SLOT(GoConfigure() ) ); listMenu->addAction(QIcon(":icons/list.png"), tr("Save Pkg List"), this, SLOT(Save_pkglist() ) ); listMenu->addSeparator(); listMenu->addAction(QIcon(":icons/search.png"), tr("Search For Text"), this, SLOT(openSearch() ) ); listMenu->addSeparator(); listMenu->addAction(QIcon(":icons/close.png"), tr("Close AppCafe"), this, SLOT(GoClose() ) ); listB->setMenu(listMenu); //Setup the search options group_search = new QFrame(this); group_search->setLayout( new QHBoxLayout() ); group_search->layout()->setContentsMargins(2,2,2,2); line_search = new QLineEdit(this); group_search->layout()->addWidget(line_search); tool_search = new QToolButton(this); group_search->layout()->addWidget(tool_search); tool_search->setIcon( QIcon(":icons/search.png") ); group_search->layout()->addItem(new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Minimum) ); //Setup the Main Interface webview = new QWebView(this); this->centralWidget()->layout()->addWidget(webview); if(webview->page()==0){ webview->setPage(new QWebPage(webview)); } webview->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); this->centralWidget()->layout()->addWidget(group_search); //Make sure the search bar is hidden to start with group_search->setVisible(false); //Create the special keyboard shortcuts QKeySequence key(QKeySequence::Find); ctrlF = new QShortcut( key, this ); key = QKeySequence(Qt::Key_Escape); esc = new QShortcut( key, this ); //Connect signals/slots connect(webview, SIGNAL(linkClicked(const QUrl&)), this, SLOT(LinkClicked(const QUrl&)) ); connect(webview, SIGNAL(loadStarted()), this, SLOT(PageStartLoading()) ); connect(webview, SIGNAL(loadProgress(int)), this, SLOT(PageLoadProgress(int)) ); connect(webview, SIGNAL(loadFinished(bool)), this, SLOT(PageDoneLoading(bool)) ); connect(webview->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT( authenticate(QNetworkReply*) ) ); connect(tool_search, SIGNAL(clicked()), this, SLOT(GoSearch()) ); connect(line_search, SIGNAL(returnPressed()), this, SLOT(GoSearch()) ); connect(ctrlF, SIGNAL(activated()), this, SLOT(openSearch()) ); connect(esc, SIGNAL(activated()), this, SLOT(closeSearch()) ); if(DEBUG){ //connect(webview, SIGNAL(statusBarMessage(const QString&)), this, SLOT(StatusTextChanged(const QString&)) ); connect(webview->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SLOT(StatusTextChanged(const QString&)) ); } this->statusBar()->setVisible(DEBUG); loadHomePage(); webview->show(); }
void GSAvatarMod::OnCancel() { // Go to previous state, or main state, or title state ? GoBack(); }
//---------------------------------------------------------------------------- //! \brief this is main work loop function for any GUI's entry, // param index is for GUI's index id //---------------------------------------------------------------------------- void CReturnDlg::WorkLoop(int index) { TCHAR buf[10] = { L"" }; m_strMsg.m_nFormat = DT_LEFT; m_strMsg2.m_nFormat = DT_RIGHT; m_Bt.ShowWindow(SW_HIDE); m_Bt1.ShowWindow(SW_HIDE); m_strMsg.SetColor(RGB(0, 0, 0),RGB( 255,255,255)); m_strMsg1.SetColor(RGB(0, 0, 0),RGB( 255,255,255)); CString str = L""; CString str1 = L""; int i = 0; switch(index) { case PASSWORD_INPUT: //Password Input m_bGoBackFlag = FALSE; for(i = 0;i<m_strPassword.GetLength();i++) str += L"*"; ShowText(L"Enter Password", L"", str); break; case AMOUNT_INPUT: //Amout Input m_bGoBackFlag = FALSE; ShowText(L"Enter Amount", L"", m_strAmount); break; case CLERK_INPUT: //Clerk ID input if (CDataFile::Read(L"CLERK ID", buf) && CString(buf) == L"Off") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; ShowText(L"Enter Clerk", L"Id", L""); break; } case RECEIP_TINPUT: //Receipt input if (CDataFile::Read(L"RECEIPT", buf) && CString(buf) == L"Off") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; ShowText(L"Enter Receipt", L"Number", L""); } break; case ENTERCARD_INPUT: //Card enter and manual Entry m_bGoBackFlag = FALSE; if (!OpenDevice()) { m_strErr1 = L"fail open device"; PostMessage(ERROR_MESSAGE, 2, 1); break; } m_strMsg.m_nFormat = DT_RIGHT; m_strMsg2.m_nFormat = DT_LEFT; ShowText(m_strAmount, L"Insert/Swipe/Tap", L"or Key Card #"); SetTimer(1, 30000, NULL); break; // debit card case DEBITCARDENTRY: m_bCancelPrint = TRUE; m_bGoBackFlag = FALSE; ShowText(L"Pass to", L"Customer", L""); SetTimer(1, 3000, NULL); m_bCancelInCustomer = TRUE; break; case DEBITCASHBACK: //CASHBACK if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } if (CDataFile::Read(L"CASHBACK", buf) && CString(buf) == L"Off") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; str = L"Enter Cashback"; str1 = L"Amount"; CString str2 = L"$0.00"; ShowText(str, str1, str2); } break; case DEBITSURCHARGEFEE: //surcharge fee if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } if (!CDataFile::Read(L"SURCHARGE", buf)) { m_bGoBackFlag?GoBack():GoNext(); return; } if (CString(buf) == L"$0.00" || CString(buf) == L"") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" Cancel", IDB_CANCEL); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" OK", IDB_OK); m_Bt1.ShowWindow(SW_SHOW); str.Format(L" %s OK?", CString(buf)); ShowText(L"Fee", str, L""); m_strSurcharge = CString(buf); break; } case DEBITTIPSELECT: //TipSelect if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } GetTipValue(); break; case DEBITTOTALCOMFIRM: // TotalComfirm m_bGoBackFlag = FALSE; if (DoConfirm(m_bReturnFlag)) GoNext(); else OnCancel(); break; case DEBITSELECTACCOUNT: // SelectAccount m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" CHEQUE"); m_Bt1.SetValue(3, L" SAVING"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.ShowWindow(SW_SHOW); ShowText(L"Select Account", L"", L""); break; case DEBITONLINEPIN: //OnlinePin if (!EnterOnlinePin()) { m_strErr1 = L"EnterOnlinePin"; PostMessage(ERROR_MESSAGE, 2, 1); } else { ShowText(L"Please Wait...", L"", L""); GoToLevel(DOTRANSACTION); } break; case DEBITMERCHANTCOPY: // for merchant copy of the receipt if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) str = L"APPROVED"; else str = L"Unsuccessful"; m_strMsg2.m_nFormat = DT_LEFT; ShowText(str, L"Retrieve Card", L"Pass to Clerk"); Print(); break; case DEBITCUSTOMERCOPY: // for Customer copy of the receipt ShowText(L"Press OK for", L"customer copy", L""); SetTimer(1, 30000, NULL); break; case DEBITWAITCOPYEND: // waiting for Customer copy of the receipt ending... if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) { str.Format(L"AUTH : %s", CString(m_TRREC.AuthCode)); m_strMsg2.m_nFormat = DT_LEFT; str1.Format(L"Inv.#: %s", CString(m_TRREC.InvoiceNo)); ShowText(L"APPROVED", str, str1); } else { str.Format(L"Declined %s", CString(m_TRREC.RespCode)); ShowText(L"Unsuccessful", str, L""); } break; case DEBITEND: // ending... CDialog::OnCancel(); break; // == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == case MANUALENTRYY: //Manual Entry enter expiry m_strMsg.SetCaption(L"Enter Expiry"); m_strMsg1.SetCaption(L"Date MMYY"); m_strMsg2.SetCaption(L""); break; case MANUAL_IMPRINT_CARD: //imprint card m_strMsg.SetCaption(L"Imprint Card"); m_strMsg1.SetCaption(L"Press OK"); m_strMsg2.SetCaption(L""); break; // == == == == == == == == == == == == == = EMV Chip Card Debit Sale :C chip page 122 == == == == == == == == == == == == == = case CHIPENTRYY: m_bCancelPrint = TRUE; m_bGoBackFlag = FALSE; ShowText(L"Pass to", L"Customer", L""); SetTimer(1, 3000, NULL); m_bCancelInCustomer = TRUE; break; case SELECT_LANGUAGE: if (SupportEnglishOrFrench()) { // get first language found will be selected // EMVSelectLanguage(???); m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" English"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" Francais"); m_Bt1.ShowWindow(SW_SHOW); str.Format(L" %s OK?", CString(buf)); ShowText(L"Select language", L"Choisir langue", L""); } break; case SELECT_APPLICATIION: /* if (!IsEMVMultiApplication()) { //Select this single Application m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" No"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" Yes"); m_Bt1.ShowWindow(SW_SHOW); str = GetNextEMVApplicationLabel(); ShowText(L"Select", str, L""); } */ break; case APPLICATION_CONFIRM: m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" No"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" Yes"); m_Bt1.ShowWindow(SW_SHOW); ShowText(m_strCurrentApplicationLabel, L"OK?", L""); break; case CHIP_DEBITCASHBACK: //CASHBACK m_bCancelPrint = TRUE; if (m_TRREC.CardType == CARD_CREDIT) { m_bGoBackFlag?GoBack():GoNext(); return; } if (CDataFile::Read(L"CASHBACK", buf) && CString(buf) == L"Off") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; str = L"Enter Cashback"; str1 = L"Amount"; CString str2 = m_strCashback;//L"$0.00"; ShowText(str, str1, str2); } break; case CHIP_DEBITSURCHARGEFEE: //surcharge fee if (m_TRREC.CardType == CARD_CREDIT) { m_bGoBackFlag?GoBack():GoNext(); return; } if (!CDataFile::Read(L"SURCHARGE", buf)) { m_bGoBackFlag?GoBack():GoNext(); return; } if (CString(buf) == L"$0.00" || CString(buf) == L"") { m_bGoBackFlag?GoBack():GoNext(); } else { m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" Cancel", IDB_CANCEL); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" OK", IDB_OK); m_Bt1.ShowWindow(SW_SHOW); str.Format(L" %s OK?", CString(buf)); ShowText(L"Fee", str, L""); m_strSurcharge = CString(buf); break; } case CHIP_DEBITTIPSELECT: //TipSelect GetTipValue(); break; case CHIP_DEBITTOTALCOMFIRM: // TotalComfirm m_bGoBackFlag = FALSE; if (DoConfirm(m_bReturnFlag)) GoNext(); else OnCancel(); break; case CHIP_DEBITSELECTACCOUNT: // SelectAccount if (m_TRREC.CardType == CARD_CREDIT) { // m_bGoBackFlag?GoBack():GoNext(); m_strMsg2.m_nFormat = DT_LEFT; ShowText(L"Please Wait...", L"Do not remove", L"Card!"); m_iLevel = EMV_WAIT; SetKeyReturn(KEY_ENTER); return; } m_bGoBackFlag = FALSE; m_Bt.SetValue(1, L" CHEQUE"); m_Bt1.SetValue(3, L" SAVING"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.ShowWindow(SW_SHOW); ShowText(L"Select Account", L"", L""); break; case CHIP_DEBITENTERPIN: //EnterPin if (!EMVEnterPin())//Fix me later { m_strErr1 = L"EMVEnterPin"; PostMessage(ERROR_MESSAGE, 2, 1); } else { if (m_TRREC.CardType == CARD_CREDIT) { GoNext(); } else { ShowText(L"Please Wait...", L"", L""); GoToLevel(DOTRANSACTION); } } break; case CHIP_PASSTOCLERK: //Pass to clerk ShowText(L"Pass to clerk", L"Do not remove card", L""); SetTimer(1, 3000, NULL); break; case CHIP_DEBITMERCHANTCOPY: // for merchant copy of the receipt if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) str = L"APPROVED"; else str = L"Unsuccessful"; m_strMsg2.m_nFormat = DT_LEFT; ShowText(str, L"Remove card", L"Pass to clerk"); Print(); break; case CHIP_DEBITCUSTOMERCOPY: // for Customer copy of the receipt ShowText(L"Press OK for", L"customer copy", L""); SetTimer(1, 30000, NULL); break; case CHIP_DEBITWAITCOPYEND: // waiting for Customer copy of the receipt ending... if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) { str.Format(L"AUTH : %s", CString(m_TRREC.AuthCode)); m_strMsg2.m_nFormat = DT_LEFT; str1.Format(L"Inv.#: %s", CString(m_TRREC.InvoiceNo)); ShowText(L"APPROVED", str, str1); } else { str.Format(L"Declined %s", CString(m_TRREC.RespCode)); ShowText(L"Unsuccessful", str, L""); } break; case CHIP_DEBITEND: // ending... if (GetScrStatus() == SCR_POWER_ON) ShowText(L"Please",L"Remove Card",L""); else CDialog::OnCancel(); break; // == == == == == == == == == == == == == = Credit Card Sale :C Swiped page 75 == == == == == == == == == == == == == == == == == = case CREDITSWIPEENTRYY://FRAUD CHECK m_bCancelPrint = TRUE; m_bGoBackFlag = FALSE; if (CDataFile::Read(L"FRAUD CHECK", buf) && CString(buf) == L"Off") { if (m_bReturnFlag) GoToLevel(DOTRANSACTION); else m_bGoBackFlag?GoBack():GoNext(); } else { ShowText(L"Enter Last", L"4 Digits", L""); } break; case CREDITSWIPETOCUSTOMER: case MANUAL_SWIPETOCUSTOMER: if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } if (CDataFile::Read(L"TIP PROMPT", buf) && CString(buf) == L"Off") { m_iLevel = DOTRANSACTION; GoToLevel(m_iLevel); } else { ShowText(L"Pass to", L"Customer", L""); SetTimer(1, 3000, NULL); m_bCancelInCustomer = TRUE; m_bGoBackFlag = FALSE; } break; case CREDITSWIPETIPSELECT: //TipSelect case MANUAL_SWIPETIPSELECT: //TipSelect if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } GetTipValue(); break; case CREDITSWIPETOTALCOMFIRM: // TotalComfirm case MANUAL_SWIPETOTALCOMFIRM: // TotalComfirm m_bGoBackFlag = FALSE; if (m_bReturnFlag) { m_bGoBackFlag?GoBack():GoNext(); break; } if (DoConfirm(m_bReturnFlag)) GoNext(); else OnCancel(); break; case CREDITSWIPETOCLERK: //Pass to clerk case MANUAL_SWIPETOCLERK: //Pass to clerk ShowText(L"Pass to", L"clerk", L""); SetTimer(1, 3000, NULL); break; case CREDITMERCHANTCOPY: // for merchant copy of the receipt m_strMsg2.m_nFormat = DT_LEFT; if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) { str.Format(L"AUTH : %s", CString(m_TRREC.AuthCode)); m_strMsg2.m_nFormat = DT_LEFT; str1.Format(L"Inv.#: %s", CString(m_TRREC.InvoiceNo)); ShowText(L"APPROVED", str, str1); } else { if (strlen(m_TRREC.HostRespText) > 0) str = CString(m_TRREC.HostRespText); else str.Format(L"Declined %s", CString(m_TRREC.RespCode)); ShowText(L"Unsuccessful", str, L""); } Print(); break; case CREDITCUSTOMERCOPY: // for Customer copy of the receipt ShowText(L"Press OK for", L"customer copy", L""); SetTimer(1, 30000, NULL); break; case CREDITWAITCOPYEND: // waiting for Customer copy of the receipt ending... if (m_TRREC.ComStatus == ST_OK && m_TRREC.TranStatus == ST_APPROVED) { str.Format(L"AUTH : %s", CString(m_TRREC.AuthCode)); m_strMsg2.m_nFormat = DT_LEFT; str1.Format(L"Inv.#: %s", CString(m_TRREC.InvoiceNo)); ShowText(L"APPROVED", str, str1); } else { str.Format(L"Declined %s", CString(m_TRREC.RespCode)); ShowText(L"Unsuccessful", str, L""); } break; case CREDITEND: // ending... // case MANUAL_END: // ending... CDialog::OnCancel(); break; // == == == == == == == == == == == == == == Do transaction (connect to host) == == == == == == == = case DOTRANSACTION: DoTransaction(); break; case CANCELENTRY: m_bCancelFlag = TRUE; ShowText(L"Transaction", L"Cancelled", L""); SetTimer(1, 30000, NULL); if (m_TRREC.CardError == CARD_NO_ERROR && m_bCancelPrint) Print(0); break; case CANCELTOCLERK: if(m_TRREC.bEmvTransaction) { GoToLevel(EMV_REMOVE_CARD); break; } if (m_bCancelInCustomer) { ShowText(L"Pass to", L"Clerk", L""); SetTimer(1, 3000, NULL); } else CDialog::OnCancel(); break; // == == == == == == == Display Window == == == == == case DISPLAY_WINDOW: m_strMsg2.m_nFormat = DT_LEFT; str = CDisplay::GetLine(1); if (str.GetLength() > 0) m_strTitle.SetCaption(str); str = CDisplay::GetLine(2); ShowText(str, CDisplay::GetLine(3), CDisplay::GetLine(4)); SetDisplayButton(); break; case EMV_SELECT_LANGUAGE: //EMV Select language m_Bt.SetValue(1, L" English"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.SetValue(3, L" Francais"); m_Bt1.ShowWindow(SW_SHOW); ShowText(L"Select language", L"Choisir langue", L""); break; case EMV_CONFIRM_AMOUNT: //EMV confirm amount str.Format(L" $ %s OK?", DealAmountStr(m_TRREC.TotalAmount)); m_strMsg2.m_nFormat = DT_LEFT; ShowText(L"Total :", str, L"Press OK to confirm"); break; case EMV_SELECT_ACCOUNT: //EMV select account m_Bt.SetValue(1, L" CHEQUE"); m_Bt1.SetValue(3, L" SAVING"); m_Bt.ShowWindow(SW_SHOW); m_Bt1.ShowWindow(SW_SHOW); ShowText(L"Select Account", L"", L""); break; case EMV_REMOVE_CARD: //EMV Remove Card if (GetScrStatus() == SCR_POWER_ON) ShowText(L"Please",L"Remove Card",L""); else CDialog::OnCancel(); break; case EMV_PASS_COUSTOMER: //EMV Remove Card ShowText(L"Pass to", L"Customer", L""); break; case EMV_START: //EMV Remove Card StartEMV(); break; } }