CRapiFileDialog::CRapiFileDialog( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : wxDialog( parent, id, title, position, size, style ) { // WDR: dialog function RapiFileDialogFunc for CRapiFileDialog RapiFileDialogFunc( this, TRUE ); GetBack()->SetWindowStyle(0); GetBack()->SetBitmapLabel(BackButtonFunc(0)); GetBack()->SetBitmapFocus(BackButtonFunc(1)); GetBack()->SetBitmapSelected(BackButtonFunc(0)); GetBack()->SetBitmapDisabled(BackButtonFunc(2)); GetUp()->SetWindowStyle(0); GetUp()->SetBitmapLabel(UpButtonFunc(0)); GetUp()->SetBitmapFocus(UpButtonFunc(1)); GetUp()->SetBitmapSelected(UpButtonFunc(0)); GetUp()->SetBitmapDisabled(UpButtonFunc(2)); m_pathname=wxT("\\"); m_mode=REPORTMODE; UpdateDialog(); m_bSortDirection=true; m_nSortColumn=0; SetSize(wxSize(400,400)); }
void Trace::EraseLaterThan(const unsigned min_time) { assert(min_time > 0); assert(!empty()); while (!empty() && GetBack().point.GetTime() > min_time) { TraceDelta &td = GetBack(); td.Remove(); auto i = delta_list.find(td); assert(i != delta_list.end()); delta_list.erase(i); --cached_size; } /* need to set deltas for first point, only one of these will occur (have to search for this point) */ if (!empty()) EraseStart(GetBack()); }
void FreeMove::ProcessInput(const Input& input, float delta) { float movAmt = m_speed; if (input.GetKeyUp(m_forwardKey)) Move(GetForward(*GetTransform()->GetRot()), movAmt); if (input.GetKeyUp(m_backKey)) Move(GetBack(*GetTransform()->GetRot()), movAmt); if ( input.GetKeyUp ( m_leftKey ) ) Move(GetLeft(*GetTransform()->GetRot()), movAmt); if ( input.GetKeyUp ( m_rightKey ) ) Move(GetRight(*GetTransform()->GetRot()), movAmt); }
void CPlayerCloneObject::Create(CPlayerObject* pPlayerObject) { m_dwRunTime = GetTickCount(); m_dwRunNextTick = 5000; strcpy(m_szName, "░А┴дк«"); m_nCurrX = pPlayerObject->m_nCurrX; m_nCurrY = pPlayerObject->m_nCurrY; m_nDirection = GetBack(pPlayerObject->m_nDirection); m_pMap = pPlayerObject->m_pMap; m_tFeature = pPlayerObject->m_tFeature; m_pMap->AddNewObject(m_nCurrX, m_nCurrY, OS_MOVINGOBJECT, this); AddRefMsg(RM_TURN, m_nDirection, m_nCurrX, m_nCurrY, 0, m_szName); }
void CRapiFileDialog::UpdateDialog(void) { m_pathname.MakeAbsolute(); m_currentpaths.clear(); m_currentsizes.clear(); m_currentdates.clear(); GetFileList()->ClearAll(); if(m_mode==REPORTMODE) { GetFileList()->SetWindowStyle(wxLC_REPORT|wxLC_SINGLE_SEL); GetFileList()->InsertColumn(0,wxT("Name"),wxLIST_FORMAT_LEFT,160); GetFileList()->InsertColumn(1,wxT("Size")); GetFileList()->InsertColumn(2,wxT("Date")); } else if(m_mode==ICONMODE) { GetFileList()->SetWindowStyle(wxLC_ICON|wxLC_SINGLE_SEL); } else if(m_mode==SMALLICONMODE) { GetFileList()->SetWindowStyle(wxLC_SMALL_ICON|wxLC_SINGLE_SEL); } else if(m_mode==LISTMODE) { GetFileList()->SetWindowStyle(wxLC_LIST|wxLC_SINGLE_SEL); } // Ensure we have a file type selection if(GetFilesOfType()->GetCount()==0) { AddFileType(wxT("All Files (*.*)"),wxT("*")); } if(GetFilesOfType()->GetSelection()==wxNOT_FOUND) { GetFilesOfType()->SetSelection(0); } // Get item names DWORD dwFound; LPCE_FIND_DATA pFoundDataArray=NULL; if(!g_RAPI.CeFindAllFiles(m_pathname.GetPath(true)+wxT("*"),FAF_ATTRIBUTES|FAF_SIZE_HIGH|FAF_SIZE_LOW|FAF_NAME|FAF_LASTWRITE_TIME,&dwFound,&pFoundDataArray)) { GetFileList()->Enable(false); } else { GetFileList()->Enable(true); } if(pFoundDataArray) { wxString strMatch=m_filetypes[GetFilesOfType()->GetSelection()]; // Fill in file list for(DWORD dw=0;dw<dwFound;dw++) { if(pFoundDataArray[dw].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { // It's a folder wxFileName dname(m_pathname.GetPath(true)+pFoundDataArray[dw].cFileName,wxT("")); m_currentpaths.push_back(dname.GetPath(true)); m_currentsizes.push_back(0); m_currentdates.push_back(pFoundDataArray[dw].ftLastWriteTime); } else { // It's a file wxFileName dname(m_pathname.GetPath(true)+pFoundDataArray[dw].cFileName); if(dname.GetFullName().Lower().Matches(strMatch.Lower())) { m_currentpaths.push_back(dname.GetFullPath()); m_currentsizes.push_back(((wxUint64)pFoundDataArray[dw].nFileSizeLow)|(((wxUint64)pFoundDataArray[dw].nFileSizeHigh)<<32)); m_currentdates.push_back(pFoundDataArray[dw].ftLastWriteTime); } } } g_RAPI.CeRapiFreeBuffer(pFoundDataArray); } wxImageList *pilSmall=new wxImageList(16,16,true,1); pilSmall->Add(RapiFileDialogBitmapsFunc(0),wxColour(255,0,255)); pilSmall->Add(RapiFileDialogBitmapsFunc(1),wxColour(255,0,255)); pilSmall->Add(RapiFileDialogBitmapsFunc(2),wxColour(255,0,255)); wxImageList *pilBig=new wxImageList(32,32,true,1); pilBig->Add(RapiFileDialogBitmapsLgFunc(0),wxColour(255,0,255)); pilBig->Add(RapiFileDialogBitmapsLgFunc(1),wxColour(255,0,255)); pilBig->Add(RapiFileDialogBitmapsLgFunc(2),wxColour(255,0,255)); size_t i=0,count=m_currentpaths.size(); for(i=0;i<count;i++) { if(m_currentpaths[i].Last()==wxT('\\')) { GetFileList()->InsertItem((long)i,wxFileName(m_currentpaths[i],wxT("")).GetDirs().Last(),0); GetFileList()->SetItemImage((long)i,0,1); if(m_mode==REPORTMODE) { // GetFileList()->SetItem((long)i,1,(const TCHAR *)GetSizeString(m_currentsizes[i])); GetFileList()->SetItem((long)i,2,(const TCHAR *)GetDateString(m_currentdates[i])); } } else { GetFileList()->InsertItem((long)i,wxFileName(m_currentpaths[i]).GetFullName(),2); if(m_mode==REPORTMODE) { GetFileList()->SetItem((long)i,1,(const TCHAR *)GetSizeString(m_currentsizes[i])); GetFileList()->SetItem((long)i,2,(const TCHAR *)GetDateString(m_currentdates[i])); } } if(m_currentpaths[i].Last()==m_pathname.GetFullPath()) { GetFileList()->SetItemState((long)i,wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED,wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED); } GetFileList()->SetItemData((long)i,(long)i); } GetFileList()->AssignImageList(pilSmall,wxIMAGE_LIST_SMALL); GetFileList()->AssignImageList(pilBig,wxIMAGE_LIST_NORMAL); // Fill in Look-In Choice Box GetLookIn()->Clear(); count=m_pathname.GetDirCount(); wxString dir=wxT("\\"); GetLookIn()->Append(dir); for(i=0;i<count;i++) { dir=wxT("\\"); for(size_t j=0;j<=i;j++) { dir+=m_pathname.GetDirs()[j]; if(j!=i) { dir+=wxT("\\"); } } GetLookIn()->Append(dir); } GetLookIn()->SetSelection((int)count); GetUp()->Enable(count>0); GetBack()->Enable(m_history.size()>1); GetOk()->Enable(m_pathname.GetFullPath().Last()!=wxT('\\')); GetFileList()->SortItems(ListCompareFunction,(long)this); }