void ResizableWindow::setFullScreen (const bool shouldBeFullScreen) { if (shouldBeFullScreen != isFullScreen()) { updateLastPos(); fullscreen = shouldBeFullScreen; if (isOnDesktop()) { if (ComponentPeer* const peer = getPeer()) { // keep a copy of this intact in case the real one gets messed-up while we're un-maximising const Rectangle<int> lastPos (lastNonFullScreenPos); peer->setFullScreen (shouldBeFullScreen); if ((! shouldBeFullScreen) && ! lastPos.isEmpty()) setBounds (lastPos); } else { jassertfalse; } } else { if (shouldBeFullScreen) setBounds (0, 0, getParentWidth(), getParentHeight()); else setBounds (lastNonFullScreenPos); } resized(); } }
void Monster::getBestWay(std::vector<std::vector <AObject*> > const &map, size_t const x0, size_t const y0, int choice[2]) { char action; int cpt = 0; size_t x = x0; size_t y = y0; if (_lastMove == LEFT) x--; if (_lastMove == RIGHT) x++; if (_lastMove == UP) y--; if (_lastMove == DOWN) y++; if (_lastPos == 4242 || cannotAccessThisCase(map, x, y, false) || isCurrentCaseDangerous(map, x, y)) { while ((action = getRandomWay(map, x0, y0)) == -1) if (++cpt > 25) { action = STAGN; break; } updateLastPos(action, x, y); } else action = _lastMove; choice[DIRECTION] = action; choice[PRIORITY] = 0; }
void ResizableWindow::setMinimised (const bool shouldMinimise) { if (shouldMinimise != isMinimised()) { if (ComponentPeer* const peer = getPeer()) { updateLastPos(); peer->setMinimised (shouldMinimise); } else { jassertfalse; } } }
void ResizableWindow::resized() { if (resizableBorder != nullptr) { #if JUCE_WINDOWS || JUCE_LINUX // hide the resizable border if the OS already provides one.. resizableBorder->setVisible (! (isFullScreen() || isUsingNativeTitleBar())); #else resizableBorder->setVisible (! isFullScreen()); #endif resizableBorder->setBorderThickness (getBorderThickness()); resizableBorder->setSize (getWidth(), getHeight()); resizableBorder->toBack(); } if (resizableCorner != nullptr) { #if JUCE_MAC // hide the resizable border if the OS already provides one.. resizableCorner->setVisible (! (isFullScreen() || isUsingNativeTitleBar())); #else resizableCorner->setVisible (! isFullScreen()); #endif const int resizerSize = 18; resizableCorner->setBounds (getWidth() - resizerSize, getHeight() - resizerSize, resizerSize, resizerSize); } if (contentComponent != nullptr) { // The window expects to be able to be able to manage the size and position // of its content component, so you can't arbitrarily add a transform to it! jassert (! contentComponent->isTransformed()); contentComponent->setBoundsInset (getContentComponentBorder()); } updateLastPos(); #if JUCE_DEBUG hasBeenResized = true; #endif }
//============================================================================== String ResizableWindow::getWindowStateAsString() { updateLastPos(); return (isFullScreen() ? "fs " : "") + lastNonFullScreenPos.toString(); }
void ResizableWindow::visibilityChanged() { TopLevelWindow::visibilityChanged(); updateLastPos(); }
void ResizableWindow::moved() { updateLastPos(); }