Example #1
0
int main(int argc, char *argv[]) {
	TCODConsole::initRoot(CON_WIDTH,CON_HEIGHT,"libtcod 1.5 dungeon tool",false);
	guicon = new TCODConsole(CON_WIDTH,CON_HEIGHT);
	guicon->setKeyColor(TCODColor(255,0,255));
	Widget::setConsole(guicon);
	TCODSystem::setFps(25);
	buildGui();
	uint8 fade=50;
	bool creditsEnd=false;

	while ( ! TCODConsole::isWindowClosed() ) {
		TCOD_key_t key=TCODConsole::checkForKeypress();
		Widget::updateWidgets(key);
		switch(key.vk) {
			case TCODK_PRINTSCREEN : TCODSystem::saveScreenshot(NULL); break;
			default:break;
		}
		render();
		guicon->setBackgroundColor(TCODColor(255,0,255));
		guicon->clear();
		Widget::renderWidgets();
		if (! creditsEnd ) {
			creditsEnd=TCODConsole::renderCredits(CON_WIDTH-20,CON_HEIGHT-7,true);
		}
		if ( Widget::focus ) {
			if ( fade < 200 ) fade += 20;
		} else {
			if ( fade > 80 ) fade -= 20;
		}
		TCODConsole::blit(guicon,0,0,CON_WIDTH,CON_HEIGHT,TCODConsole::root,0,0,fade);
		TCODConsole::flush();
	}

	return 0;
}
CoaToolsChangeDebugSettings::CoaToolsChangeDebugSettings()
: CoaToolWindow("CoaToolsChangeDebugSettings", 0)
{
   BEGIN;
   REGISTERSINGLETON("CoaToolsChangeDebugSettings");
   setWindowTitle(tr("Change Debug Settings"));
   buildGui();
   readSettings();
}
Example #3
0
NYBOT::NYBOT ()
{
  pluginName = "NYBOT";
  helpFile = "nybot.html";
  cancelFlag = FALSE;

  connect(this, SIGNAL(signalGetFileDone(bool)), this, SLOT(fileDone(bool)));
  connect(this, SIGNAL(signalTimeout()), this, SLOT(timeoutError()));

  buildGui();
  loadSettings();
  qInitNetworkProtocols();
  resize(400, 400);
}
Example #4
0
OptionsState::OptionsState(const std::string &name, const Json::Value &params, GameController & controller, ServiceLocator &services)
    : GameState()
    , name(name)
    , controller(controller)
    , guiService(services.locateService<GuiService>(Services::GUISERVICE))
    , input(services.locateService<InputService>(Services::INPUT))
    , guiContainer(new gcn::Container())
    , guiLabel(new gcn::Label())
    , guiMenu(new gui::Menu())
    , guiActionListener(nullptr)
    , guiSelectionListener(nullptr)
    , goToNextState(false)
{
    buildGui();
}
Example #5
0
int main(int argc, char *argv[]) {
	TCODConsole::initRoot(HM_WIDTH,HM_HEIGHT,"height map tool",false);
	guicon = new TCODConsole(HM_WIDTH,HM_HEIGHT);
	guicon->setKeyColor(TCODColor(255,0,255));
	Widget::setConsole(guicon);
	TCODSystem::setFps(25);
	initColors();
	buildGui();
	hm = new TCODHeightMap(HM_WIDTH,HM_HEIGHT);
	hmold = new TCODHeightMap(HM_WIDTH,HM_HEIGHT);
	rnd=new TCODRandom(seed);
	noise=new TCODNoise(2,rnd);
	uint8 fade=50;
	bool creditsEnd=false;

	while ( ! TCODConsole::isWindowClosed() ) {
		render();
		guicon->setDefaultBackground(TCODColor(255,0,255));
		guicon->clear();
		Widget::renderWidgets();
		if (! creditsEnd ) {
			creditsEnd=TCODConsole::renderCredits(HM_WIDTH-20,HM_HEIGHT-7,true);
		}
		if ( Widget::focus ) {
			if ( fade < 200 ) fade += 20;
		} else {
			if ( fade > 80 ) fade -= 20;
		}
		TCODConsole::blit(guicon,0,0,HM_WIDTH,HM_HEIGHT,TCODConsole::root,0,0,fade/255.0f,fade/255.0f);
		TCODConsole::flush();
		TCOD_key_t key;
		TCOD_mouse_t mouse;
		TCODSystem::checkForEvent(TCOD_EVENT_KEY_PRESS|TCOD_EVENT_MOUSE,&key,&mouse);
		Widget::updateWidgets(key,mouse);
		switch(key.c) {
			case '+' : (new AddLevelOperation((mapmax-mapmin)/50))->run(); break;
			case '-' : (new AddLevelOperation(-(mapmax-mapmin)/50))->run(); break;
			default:break;
		}
		switch(key.vk) {
			case TCODK_PRINTSCREEN : TCODSystem::saveScreenshot(NULL); break;
			default:break;
		}
	}

	return 0;
}
Example #6
0
statisticsFrame::statisticsFrame(wxWindow* parent, configClass *config, cycleDataClass *cycleData, int visibleChartIndex, wxWindowID id,const wxPoint& pos,const wxSize& size)
{
    /** Update when you add new chart */
    m_charts.Add(new chart(config, cycleData));
    m_charts.Add(new phasesChart(config, cycleData));
    m_charts.Add(new lutealPhasesChart(config, cycleData));
    m_charts.Add(new cyclesLengthChart(config, cycleData));
    m_charts.Add(new temperaturesChart(config, cycleData));

    m_parent = parent;
    m_config = config;
    m_cycleData = cycleData;

    buildGui(parent);

    addAvailableChartsToTheList();

    if (visibleChartIndex > 0)
        listBoxChartList->SetSelection(visibleChartIndex-1);
    chartWindow->setChart(getChart(visibleChartIndex));
    chartWindow->Refresh();
}
//------------------------------------------------------------------------------
MyguiConsoleUI::MyguiConsoleUI()
    : mwWnd(0), mwCmd(0), mwCwd(0), mwOutput(0), mFontWidth(0) {
  buildGui();
  // @TODO trying to get font width directly, but it's not precise, i must miss
  // someghing.
  // MyGUI::IFont* font =
  // MyGUI::FontManager::getInstance().getByName(mwOutput->getFontName());
  // auto glyph = font->getGlyphInfo('a');
  // Real fontWidth = (glyph->width + glyph->bearingX) /
  //(glyph->height + glyph->bearingY) *
  // mwOutput->getFontHeight();

  // use textview to get font size, don't insert special character in output
  // before this!!!!
  MyGUI::IntSize textSize = mwOutput->getTextSize();
  mFontWidth =
      static_cast<Real>(textSize.width) / mwOutput->getCaption().size();

  mwOutput->setCaption("");
  mwCmd->setCaption("");
  mwCmd->setCaption("");
}
Example #8
0
Yahoo::Yahoo ()
{
  pluginName = "Yahoo";
  helpFile = "yahoo.html";
  url.setAutoDelete(TRUE);
  currentUrl = 0;
  fileCount = 0;
  fileCounter = 0;

  config.getData(Config::DataPath, dataPath);
  dataPath.append("/Stocks/Yahoo");

  config.getData(Config::Home, file);
  file.append("/yahooDownload");

  q3InitNetworkProtocols();

  buildGui();

  loadSettings();

  connect(this, SIGNAL(signalGetFileDone(bool)), this, SLOT(fileDone(bool)));
  connect(this, SIGNAL(signalTimeout()), this, SLOT(timeoutError()));

  monthList.append("Jan");
  monthList.append("Feb");
  monthList.append("Mar");
  monthList.append("Apr");
  monthList.append("May");
  monthList.append("Jun");
  monthList.append("Jul");
  monthList.append("Aug");
  monthList.append("Sep");
  monthList.append("Oct");
  monthList.append("Nov");
  monthList.append("Dec");

  resize(640, 480);
}
SkillPanel::SkillPanel(QObject* parent, QString img,QString name, QString des)
{
    this->setParent(parent);
    imgSrc.load("img/imgSrc.jpg");
    buildGui(img, name, des);
}
 /*
   PresetsEditorWindow::PresetsEditorWindow(Ptr<db::Profile> p) :_profile(p), Wt::Ext::Dialog("Preset Editor") {
     buildGui();
     editor=new PresetsEditor(_profile);
     layout()->addWidget(editor);
   }
   */
   PresetsEditorWindow::PresetsEditorWindow(std::string filename) : Wt::Ext::Dialog("Preset Editor") {
     buildGui();
     editor=new PresetsEditor(filename);
     layout()->addWidget(editor);
   }
Example #11
0
PrinterEmulator::PrinterEmulator()
{
	buildGui();
	buildPrinterDataReader();
}
Example #12
0
MailView::MailView(Mail* mail) {
    this->mail = mail;
    buildGui();
    setMail(mail);
}
Example #13
0
    StageSelectState::StageSelectState(const std::string &name, const Json::Value &params, GameController & controller, ServiceLocator &services)
        : name(name)
        , controller(controller)
        , guiService(services.locateService<GuiService>(Services::GUISERVICE))
        , audioService(services.locateService<AudioService>(Services::AUDIO))
        , gameProgress(services.locateService<GameProgress>(Services::GAMEPROGRESS))
        , taskQueue()
        , guiContainer(new gcn::Container())
        , guiSelectedCellLabel(new gcn::Label())
        , guiCursorIcon()
        , guiForeground()
        , guiBackground()
        , guiLeftEye()
        , guiRightEye()
        , cursorRow(DEFAULT_CURSOR_ROW)
        , cursorColumn(DEFAULT_CURSOR_COLUMN)
        , enableCursorMovement(false)
    {
        std::weak_ptr<ImageCache> imageCache = services.locateService<ImageCache>(Services::IMAGECACHE);

        // Load sprites from config
        // TODO: This needs to be refactored to be safer and things like that
        // TODO: Need a utility method to load sf:Sprite from JSON
        if(auto imageCachePtr = imageCache.lock()) {
            background.setTexture(*imageCachePtr->get(params[PROPERTY_BACKGROUND].asString()).get());
            foreground.setTexture(*imageCachePtr->get(params[PROPERTY_FOREGROUND].asString()).get());
            leftEye.setTexture(*imageCachePtr->get(params[PROPERTY_EYE_SPRITE].asString()).get());
            rightEye.setTexture(*imageCachePtr->get(params[PROPERTY_EYE_SPRITE].asString()).get());
        }

        guiCursorIcon.reset(new gcn::Icon(params[PROPERTY_CURSOR_SPRITE].asString()));

        guiCursorIcon->setX(-100);
        guiCursorIcon->setY(-100);

        // Load eye positions
        // There are 9 positions; 18 points total (one for left, one for right eye)
        const Json::Value &jsonEyePositions = params[PROPERTY_EYE_POSITIONS];
        if(static_cast<int>(jsonEyePositions.size()) == NUM_OF_PORTRAITS) {
            for(int i = 0; i < NUM_OF_PORTRAITS; ++i) {
                const Json::Value &jsonEyePosition = jsonEyePositions[i];
                float leftEyeX = static_cast<float>(jsonEyePosition[0u].get(PROPERTY_X, 0).asInt());
                float leftEyeY = static_cast<float>(jsonEyePosition[0u].get(PROPERTY_Y, 0).asInt());
                float rightEyeX = static_cast<float>(jsonEyePosition[1u].get(PROPERTY_X, 0).asInt());
                float rightEyeY = static_cast<float>(jsonEyePosition[1u].get(PROPERTY_Y, 0).asInt());

                Point2D<float> leftEyePosition(leftEyeX, leftEyeY);
                Point2D<float> rightEyePosition(rightEyeX, rightEyeY);

                eyePositions.push_back(std::make_pair(leftEyePosition, rightEyePosition));
            }
        }

        // Load cursor positions
        const Json::Value &jsonCursorPositions = params[PROPERTY_CURSOR_POSITIONS];
        if(static_cast<int>(jsonCursorPositions.size()) == NUM_OF_PORTRAITS) {
            for(int i = 0; i < NUM_OF_PORTRAITS; ++i) {
                const Json::Value &jsonCursorPosition = jsonCursorPositions[i];
                float cursorX = static_cast<float>(jsonCursorPosition.get(PROPERTY_X, 0).asInt());
                float cursorY = static_cast<float>(jsonCursorPosition.get(PROPERTY_Y, 0).asInt());

                Point2D<float> position(cursorX, cursorY);

                cursorPositions.push_back(position);
            }
        }

        buildGui();
    }
Example #14
0
Client::Client(QWidget *parent)
    : QMainWindow(parent)
{
    buildGui();
}