void VRect::Intersect (const VRect& inRect) { GReal newLeft = Max(fX, inRect.GetX()); GReal newTop = Max(fY, inRect.GetY()); GReal newRight = Min(GetRight(), inRect.GetRight()); GReal newBottom = Min(GetBottom(), inRect.GetBottom()); if (newRight > newLeft && newBottom > newTop) SetCoords(newLeft, newTop, newRight - newLeft, newBottom - newTop); else SetCoords(0, 0, 0, 0); }
void WeatherFaxWizard::MakeNewCoordinates() { /* make a new coord, yet making sure it has a unique name */ wxString newcoordname; int cc = m_Coords.GetCount(); for(int n=0, i=-1; i != cc; n++) { if(n) newcoordname = wxString::Format(m_NewCoordBaseName + _T(" %d"), n); else newcoordname = m_NewCoordBaseName; if(!cc) break; for(i=0; i<cc; i++) if(m_Coords[i]->name == newcoordname) break; } m_cbCoordSet->Append(newcoordname); int sel = 0; for(int i=0; i<cc; i++) { if(m_curCoords == m_Coords[i]) sel = i+1; m_cbCoordSet->Append(m_Coords[i]->name); } m_newCoords = new WeatherFaxImageCoordinates(newcoordname); SetCoords(sel); if(m_Coords.GetCount() == 0) m_cbCoordSet->Disable(); }
LRESULT FAR PASCAL WndProc( HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam ) { HDC hdc; PAINTSTRUCT ps; switch (iMessage) { case WM_SIZE: SetCoords( lParam ); /* Call into library.lib */ return 0; case WM_PAINT: hdc = BeginPaint( hWnd, &ps ); DrawHappyFace( hdc ); /* Call into library.lib */ PrintMessage( hdc, "CPP User" ); /* Call into library.lib */ EndPaint( hWnd, &ps ); return 0; case WM_DESTROY: PostQuitMessage( 0 ); return 0; } return DefWindowProc( hWnd, iMessage, wParam, lParam ); }
void FolderTree::SetScreenPosition() { if (IsFullScreen) TreeKeyBar.Hide(); SetCoords(); Show(); }
void FolderTree::SetScreenPosition() { if (IsFullScreen) m_windowKeyBar->Hide(); SetCoords(); Show(); }
void VRect::Union (const VRect& inRect) { GReal newLeft = Min(fX, inRect.fX); GReal newTop = Min(fY, inRect.fY); GReal newRight = Max(GetRight(), inRect.GetRight()); GReal newBottom = Max(GetBottom(), inRect.GetBottom()); SetCoords(newLeft, newTop, newRight - newLeft, newBottom - newTop); }
cxAtlas *cxAtlas::SetFramesIdx(cxInt idx) { CX_ASSERT(cframes != nullptr, "frames not set"); cidx = idx; const cxArray *layers = cframes->Layers(idx); CX_ASSERT(layers != nullptr, "frames null"); SetTexture(cframes->Texture()); SetCoords(layers, cframes); return this; }
void FolderTree::ResizeConsole() { //if ( TopScreen ) // delete TopScreen; //TopScreen=nullptr; Hide(); SetCoords(); Tree->SetPosition(X1,Y1,X2,Y2); //ReadHelp(StackData.HelpMask); FrameManager->ImmediateHide(); FrameManager->RefreshFrame(); }
FolderTree::FolderTree(string &strResultFolder,int iModalMode,int IsStandalone,bool IsFullScreen): Tree(nullptr), FindEdit(nullptr), ModalMode(iModalMode), IsFullScreen(IsFullScreen), IsStandalone(IsStandalone), PrevMacroMode(CtrlObject->Macro.GetMode()) { SetDynamicallyBorn(FALSE); SetRestoreScreenMode(TRUE); if (ModalMode != MODALTREE_FREE) strResultFolder.Clear(); KeyBarVisible = TRUE; // Заставим обновлятся кейбар //TopScreen=new SaveScreen; SetCoords(); if ((Tree=new TreeList(FALSE))) { CtrlObject->Macro.SetMode(MACRO_FINDFOLDER); MacroMode = MACRO_FINDFOLDER; strLastName.Clear(); Tree->SetModalMode(ModalMode); Tree->SetPosition(X1,Y1,X2,Y2); if (ModalMode == MODALTREE_FREE) Tree->SetRootDir(strResultFolder); Tree->SetVisible(TRUE); Tree->Update(0); // если было прерывание в процессе сканирования и это было дерево копира... if (Tree->GetExitCode()) { if (!(FindEdit=new Edit)) { SetExitCode(XC_OPEN_ERROR); return; } FindEdit->SetEditBeyondEnd(FALSE); FindEdit->SetPersistentBlocks(Global->Opt->Dialogs.EditBlock); InitKeyBar(); FrameManager->ExecuteModal(this); //OT } strResultFolder = strNewFolder; } else { SetExitCode(XC_OPEN_ERROR); } }
ETankSpark::ETankSpark(ZTime *ztime_, int cx_, int cy_, int direction_) : ZEffect(ztime_) { double &the_time = ztime->ztime; if(!finished_init) { killme = true; return; } SetCoords(cx_, cy_, direction_); ni_max = 36 + (rand()%25); ni_i = 0; ni = 0; next_ni_time = the_time + ETANKSPARK_TIME; }
void VRect::Union (const VRect& inRect) { if (IsEmpty()) { fX = inRect.fX; fY = inRect.fY; fWidth = inRect.fWidth; fHeight = inRect.fHeight; } else if (!inRect.IsEmpty()) { GReal newLeft = Min(fX, inRect.fX); GReal newTop = Min(fY, inRect.fY); GReal newRight = Max(GetRight(), inRect.GetRight()); GReal newBottom = Max(GetBottom(), inRect.GetBottom()); SetCoords(newLeft, newTop, newRight - newLeft, newBottom - newTop); } }
ETankSmoke::ETankSmoke(ZTime *ztime_, int cx_, int cy_, int direction_, bool do_spark_) : ZEffect(ztime_) { double &the_time = ztime->ztime; if(!finished_init) { killme = true; return; } cx = cx_; cy = cy_; ni = 0; direction = direction_; do_spark = do_spark_; SetCoords(cx, cy, direction, x, y); next_ni_time = the_time + ETANKSMOKE_TIME; }
void FolderTree::init(string &strResultFolder) { m_windowKeyBar = std::make_unique<KeyBar>(shared_from_this()); SetRestoreScreenMode(true); if (ModalMode != MODALTREE_FREE) strResultFolder.clear(); m_KeyBarVisible = TRUE; // Заставим обновляться кейбар //TopScreen=new SaveScreen; SetCoords(); Tree.reset(new TreeList(nullptr, false)); SetMacroMode(MACROAREA_FINDFOLDER); strLastName.clear(); Tree->SetModalMode(ModalMode); Tree->SetPosition(m_X1,m_Y1,m_X2,m_Y2); if (ModalMode == MODALTREE_FREE) Tree->SetRootDir(strResultFolder); Tree->SetVisible(true); Tree->Update(0); // если было прерывание в процессе сканирования и это было дерево копира... if (Tree->GetExitCode()) { FindEdit = std::make_unique<EditControl>(shared_from_this(),shared_from_this().get()); FindEdit->SetEditBeyondEnd(false); FindEdit->SetPersistentBlocks(Global->Opt->Dialogs.EditBlock); InitKeyBar(); Global->WindowManager->ExecuteWindow(shared_from_this()); //OT Global->WindowManager->ExecuteModal(shared_from_this()); //OT } strResultFolder = strNewFolder; }
void FolderTree::ResizeConsole() { Hide(); SetCoords(); Tree->SetPosition(m_X1,m_Y1,m_X2,m_Y2); }