void GUIToggle::_setToggleGroup(SPtr<GUIToggleGroup> toggleGroup) { mToggleGroup = toggleGroup; bool isToggled = false; if(mToggleGroup != nullptr) // If in group ensure at least one element is toggled on { for(auto& toggleElem : mToggleGroup->mButtons) { if(isToggled) { if(toggleElem->mIsToggled) toggleElem->toggleOff(); } else { if(toggleElem->mIsToggled) isToggled = true; } } if(!isToggled && !toggleGroup->mAllowAllOff) toggleOn(); } }
inGameStatsRenderComponent::inGameStatsRenderComponent(int _background, float scale) { sceneMan = SceneManager::GetSceneManager(); layer = "layer1"; int w, h; RenderManager::getRenderManager()->getWindowSize(&w, &h); purple = new TextAlignment::COLOR(160, 32, 240); yellow = new TextAlignment::COLOR(250, 165, 10); objRef = sceneMan->InstantiateObject(sceneMan->findLayer(layer), _background, -5, 1, true); objRef->setPos(w / 4.0f, h / 5.0f); //objRef->setPos(w / 2.0f, h / 2.0f); background = _background; objRef->setPos(w / 4.0f, h / 5.0f); objRef->setScale(scale); createText(); createScoreText(); toggleOn(false); }
bool GUIToggle::_mouseEvent(const GUIMouseEvent& ev) { bool processed = GUIButtonBase::_mouseEvent(ev); if(ev.getType() == GUIMouseEventType::MouseUp) { if (!_isDisabled()) { if (mIsToggled) toggleOff(); else toggleOn(); } processed = true; } return processed; }
// Bootstrap processor starts running C code here. // Allocate a real stack and switch to it, first // doing some setup required for memory allocator to work. int main(void) { kinit1(end, P2V(4*1024*1024)); // phys page allocator kvmalloc(); // kernel page table mpinit(); // collect info about this machine lapicinit(); seginit(); // set up segments cprintf("\ncpu%d: starting xv6\n\n", cpu->id); picinit(); // interrupt controller ioapicinit(); // another interrupt controller consoleinit(); // I/O devices & their interrupts uartinit(); // serial port initGraphMode(); initDom(); tryOnce(); toggleOn(); pinit(); // process table toggleOn(); tvinit(); // trap vectors toggleOn(); binit(); // buffer cache toggleOn(); fileinit(); // file table toggleOn(); iinit(); // inode cache toggleOn(); ideinit(); // disk toggleOn(); if(!ismp) timerinit(); // uniprocessor timer toggleOn(); startothers(); // start other processors toggleOn(); kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() toggleOn(); txt_initLock(); mouseEnable(); initProcessMsgMap(); userinit(); // first user process toggleOn(); endToggle(); // Finish setting up this processor in mpmain. mpmain(); }
int main() { toggleOn(); }
int main() { toggleOn(); while(1); }