void CMessageFrame::OnEditRedo() { DoCommand(MSG_Redo); MessageKey key = MSG_MESSAGEKEYNONE; MSG_FolderInfo *folder = NULL; if ( UndoComplete == MSG_GetUndoStatus(m_pPane) ) { if (MSG_GetUndoMessageKey(m_pPane, &folder, &key) && folder) LoadMessage(folder, key); } }
void CEditorAppView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& aCustomMessage) { if (iContainer == NULL) { // iContainer = CTestEditorAppContainer::NewL(ClientRect()); iContainer = CMsgEditorView::NewL(*this, 0); TInt res(R_UNIEDITOR_TO); iContainer->AddControlFromResourceL(res, EMsgAddressControl, 0, EMsgHeader); res = R_UNIEDITOR_DATETIME; iContainer->AddControlFromResourceL(res, EMsgDateTimeControl, EMsgAppendControl, EMsgHeader); iContainer->ExecuteL(ClientRect(), 0); if (aCustomMessage.Length() > 0) { if (aCustomMessage.Compare(KViewChangeFromLoadDraft) == 0) { LoadMessage(SHModel()->GetDraftMsg()); } else if (aCustomMessage.Compare(KViewChangeFromModify) == 0) { LoadMessage(); } } AppUi()->AddToStackL(*this, iContainer); iContainer->DrawNow(); //add your init code ... } }
void CMessageFrame::DoNavigate( MSG_MotionType msgCommand ) { if ( m_pMessagePane ) { MSG_FolderInfo* folder, *newFolder = NULL; MessageKey key; MSG_ViewIndex viewIndex; MSG_GetCurMessage( m_pMessagePane, &folder, &key, &viewIndex); if ( key != MSG_MESSAGEKEYNONE ) { MessageKey resultId = MSG_MESSAGEKEYNONE; MSG_ViewIndex resultIndex = viewIndex; MSG_ViewIndex threadIndex; MSG_ViewNavigate( m_pMessagePane, msgCommand, viewIndex, &resultId, &resultIndex, &threadIndex, &newFolder); if ( resultId != MSG_MESSAGEKEYNONE ) { if ( ( resultId != key ) ) { if (newFolder && folder != newFolder) LoadMessage(newFolder, resultId); else LoadMessage(folder, resultId); } } else if ( newFolder != NULL) { m_bNavPending = TRUE; m_navPending = msgCommand; MSG_LoadFolder(m_pPane, newFolder); } } m_pInfoBar->Update(); } }
void AwayEditorWindow::MessageReceived(BMessage* message) { switch(message->what) { case AWAY_NEW: NewMessage(); break; case AWAY_SAVE: SaveMessage(); break; case AWAY_DELETE: DeleteMessage(); break; case AWAY_CHANGED: isDirty = true; break; case BEAIM_RELOAD_PREF_SETTINGS: enterIsNewline = prefs->ReadBool( "EnterInsertsNewline", false ); tabIsTab = prefs->ReadBool( "TabIsTab", false ); break; case AWAY_SELECTED: { AwayItem* item = (AwayItem*)genView->listview->ItemAt( genView->listview->CurrentSelection() ); if( !item || !CheckMessage() ) { EnableMessageStuff(false); return; } LoadMessage( item->GetName() ); break; } case BEAIM_REFRESH_LANG_STRINGS: RefreshLangStrings(); break; default: BWindow::MessageReceived(message); } }
int zkd_main_file(int argc, char** argv) { if (argc != 2 && argc != 4) { printf("Usage:\n"); printf("%s filename [(-t | -s | -i) n]\n", argv[0]); printf("-t n limits runtime to n seconds\n"); printf("-s n limits solution score to n\n"); printf("-i n limits solution to n iterations\n"); printf("If no limit options are given, solver will run for 2 minutes\n"); } LoadMessage(argv[1], 0); srand(time(0)); /*setup directories*/ StopSolve(); memset(&siSolveInfo,0,sizeof(SOLVEINFO)); siSolveInfo.ioc_weight=siSolveInfo.ent_weight=siSolveInfo.chi_weight=5; siSolveInfo.dioc_weight=0; siSolveInfo.max_tabu=300; siSolveInfo.swaps=5; siSolveInfo.max_tol=40; siSolveInfo.disp_all=DispAll; siSolveInfo.disp_info=DispInfo; sprintf(siSolveInfo.log_name,"/%s","log.txt"); siSolveInfo.optima_tabu=&tabu_list; SetInfo(&siSolveInfo); Reset(); if (argc == 4) { if (!strcmp(argv[2], "-t")) { siSolveInfo.time_limit = atoi(argv[3]); siSolveInfo.iteration_limit = -1; siSolveInfo.score_limit = -1; } else if (!strcmp(argv[2], "-s")) { siSolveInfo.score_limit = atoi(argv[3]); siSolveInfo.iteration_limit = -1; siSolveInfo.time_limit = -1; } else if (!strcmp(argv[2], "-i")) { siSolveInfo.iteration_limit = atoi(argv[3]); siSolveInfo.time_limit = -1; siSolveInfo.score_limit = -1; } } else if (argc == 2) { siSolveInfo.time_limit = 120; siSolveInfo.iteration_limit = -1; siSolveInfo.score_limit = -1; } //language iLang=0; SetLanguage(); //sovle parameters message.SetBlockSize(1); //SetSolveTypeFeatures(); InitKey(); Solve(); return siSolveInfo.best_score; }