void SeparateTabWidget::setCurrentIndex (int index)
	{
		if (index >= WidgetCount ())
			index = WidgetCount () - 1;

		auto rootWM = Core::Instance ().GetRootWindowsManager ();
		auto tabManager = rootWM->GetTabManager (Window_);

		MainStackedWidget_->setCurrentIndex (-1);
		if (CurrentToolBar_)
		{
			RemoveWidgetFromSeparateTabWidget (CurrentToolBar_);
			CurrentToolBar_ = nullptr;
		}

		MainTabBar_->setCurrentIndex (index);

		if (auto bar = tabManager->GetToolBar (index))
		{
			AddWidget2SeparateTabWidget (bar);
			bar->show ();
			CurrentToolBar_ = bar;
		}
		MainStackedWidget_->setCurrentIndex (index);

		CurrentIndex_ = index;
		if (CurrentWidget_ != Widget (index))
		{
			PreviousWidget_ = CurrentWidget_;
			CurrentWidget_ = Widget (index);
			emit currentChanged (index);
		}
	}
	void SeparateTabWidget::handleCloneTab ()
	{
		const auto index = sender ()->property ("TabIndex").toInt ();
		const auto widget = Widget (index);
		const auto irt = qobject_cast<IRecoverableTab*> (widget);

		const auto plugin = qobject_cast<ITabWidget*> (widget)->ParentMultiTabs ();
		const auto ihrt = qobject_cast<IHaveRecoverableTabs*> (plugin);

		if (!widget || !irt || !ihrt)
		{
			qWarning () << Q_FUNC_INFO
					<< "something required is null:"
					<< widget
					<< irt
					<< ihrt;
			return;
		}

		const auto& data = irt->GetTabRecoverData ();

		QList<QPair<QByteArray, QVariant>> props;
		for (const auto& name : widget->dynamicPropertyNames ())
			if (name.startsWith ("SessionData/"))
				props.append ({ name, widget->property (name) });

		ihrt->RecoverTabs ({ { data, props } });
	}
Example #3
0
	void Plugin::unPinTab (int index)
	{
		const int windowId = Proxy_->GetRootWindowsManager ()->GetPreferredWindowIndex ();
		auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId);
		if (!window)
			return;
		auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId);
		if (!tw)
			return;

		if (index == -1)
			index = sender ()->property ("Leechcraft/PinTab/CurrentIndex").toInt ();

		if (index < 0 ||
				index >= tw->WidgetCount ())
		{
			qWarning () << Q_FUNC_INFO
					<< "invalid index "
					<< index;
			return;
		}

		int realIndex = tw->TabData (index).toInt ();
		tw->Widget (index)->
				setProperty ("SessionData/org.LeechCraft.PinTab.PinState", false);
		auto data = Window2PinTabsIndex2TabData_ [window].take (realIndex);

		tw->SetTabText (index, data.first);
		tw->SetTabClosable (index, true, data.second);

		tw->MoveTab (index, Window2PinTabsIndex2TabData_.value (window).count ());
	}
Example #4
0
// When W is to be destroyed, remove all references in Widget(CLIENT_DATA)
static void RemoveCallbacksCB(Widget w, XtPointer client_data, XtPointer)
{
    Widget ref = Widget(client_data);
    XtRemoveCallback(ref, XmNokCallback,      UnmanageThisCB, XtPointer(w));
    XtRemoveCallback(ref, XmNcancelCallback,  UnmanageThisCB, XtPointer(w));
    XtRemoveCallback(ref, XmNdestroyCallback, RemoveCallbacksCB, XtPointer(w));
}
Example #5
0
	void Plugin::pinTab (int index)
	{
		const int windowId = Proxy_->GetRootWindowsManager ()->GetPreferredWindowIndex ();
		auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId);
		if (!window)
			return;
		auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId);
		if (!tw)
			return;

		if (index == -1)
			index = sender ()->property ("Leechcraft/PinTab/CurrentIndex").toInt ();

		if (index < 0 ||
				index >= tw->WidgetCount ())
		{
			qWarning () << Q_FUNC_INFO
					<< "invalid index "
					<< index;
			return;
		}

		tw->Widget (index)->
				setProperty ("SessionData/org.LeechCraft.PinTab.PinState", true);
		++Window2Id_ [window];
		auto pair = qMakePair (tw->TabText (index),
				tw->TabButton (index, CloseSide_));
		tw->SetTabData (index, Window2Id_ [window]);
		tw->SetTabText (index, "");
		tw->SetTabClosable (index, false);
		Window2PinTabsIndex2TabData_ [window] [Window2Id_.value (window, 0)] = pair;

		tw->MoveTab (index, Window2PinTabsIndex2TabData_ [window].count () - 1);
	}
Example #6
0
File: main.cpp Project: CCJY/coliru
int main() {
    auto t = std::forward_as_tuple(Widget(12));
    //auto t = std::tuple<Widget&&>(Widget(12));
    std::cout << std::get<0>(t).h;
    /*
    RvalueTest<Widget> r(Widget(12));
    std::cout << r.value.h;*/
}
	void SeparateTabWidget::RemoveTab (int index)
	{
		if (index >= WidgetCount ())
		{
			qWarning () << Q_FUNC_INFO
					<< "invalid index"
					<< index;
			return;
		}

		Util::DefaultHookProxy_ptr proxy (new Util::DefaultHookProxy);
		const auto winId = Core::Instance ().GetRootWindowsManager ()->GetWindowIndex (Window_);
		emit hookTabIsRemoving (proxy, index, winId);
		if (proxy->IsCancelled ())
			return;

		const auto widget = Widget (index);

		if (widget == PreviousWidget_)
			PreviousWidget_ = 0;
		else if (widget == CurrentWidget_)
			CurrentWidget_ = 0;

		if (auto itw = qobject_cast<ITabWidget*> (widget))
			if (auto bar = itw->GetToolBar ())
				RemoveWidgetFromSeparateTabWidget (bar);

		if (!CurrentWidget_)
		{
			int nextIdx = -1;
			switch (MainTabBar_->selectionBehaviorOnRemove ())
			{
			case QTabBar::SelectLeftTab:
				nextIdx = index - 1;
				if (nextIdx == -1 && WidgetCount () > 1)
					nextIdx = 1;
				break;
			case QTabBar::SelectRightTab:
				nextIdx = index == WidgetCount () - 1 ?
						WidgetCount () - 2 :
						index + 1;
				break;
			default:
				nextIdx = IndexOf (PreviousWidget_);
				break;
			}

			if (nextIdx >= 0)
				setCurrentTab (nextIdx);
		}

		MainStackedWidget_->removeWidget (widget);
		MainTabBar_->removeTab (index);

		TabNames_.removeAt (index);

		widget->setParent (0);
	}
Example #8
0
	void Plugin::hookTabIsRemoving (IHookProxy_ptr, int index, int windowId)
	{
		const auto rootWM = Proxy_->GetRootWindowsManager ();
		const auto tabWidget = rootWM->GetTabWidget (windowId);
		const auto widget = tabWidget->Widget (index);

		handleRemoveTab (widget);
		SessionsMgr_->handleRemoveTab (widget);
	}
Example #9
0
static void HistoryDestroyedCB(Widget, XtPointer client_data, XtPointer)
{
    Widget old_gdb_history_w = Widget(client_data);
    if (gdb_history_w == old_gdb_history_w)
    {
	gdb_history_w = 0;
	gdb_commands_w = 0;
    }
}
Example #10
0
WidgetInfo::WidgetInfo(string path)
{
	xml_document doc;
	doc.load_file(path.c_str());assert(doc);
	xml_node node = doc.root().first_child().first_child();
	_w = Widget(node);
	_btree.reload(node.attribute("behaviour").as_string());
	_parent = NULL;
}
Example #11
0
File: main.cpp Project: CCJY/coliru
Widget createWidget() {
  Builder builder; 
  builder.doSomeBuilding();    
  try {    
    Foo&& foo = builder.a_func_that_may_throw(); 
  } catch (const std::exception& e) {
    // Log that we can't get a Foo and deal with it...
    return Widget(); 
  }
  
  try {
    Bar&& bar = builder.another_func_that_may_throw();
  } catch (const std::exception& e) {
    // Log that we can't get a Bar and deal with it...
    return Widget();
  }
  return Bar(std::move(foo), std::move(bar)); // Want to use rvalue references here but can't!
}
static void DestroyCB(XtPointer client_data, XtIntervalId *id)
{
    Widget w = Widget(client_data);

    if (w != 0)
    {
	XtRemoveCallback(w, XmNdestroyCallback, CancelTimer, XtPointer(*id));
	XtDestroyWidget(w);
    }
}
Example #13
0
WXmToggleButtonGadget
WXmRadioBox :: AddToggleButton (char* name, XtCallbackProc proc, caddr_t closure, ArgList args, Cardinal card)
{
	WXmToggleButtonGadget bg(widget, name, args, card);
	if (proc)
		XtAddCallback (Widget(bg), XmNvalueChangedCallback,
			       proc, closure);

	return bg;
}
Example #14
0
Widget Camera::config() {
    std::lock_guard<std::mutex> cg(configmutex);
    std::lock_guard<std::mutex> g(mutex);

	CameraWidget *w;
	int ret;
	if ((ret = gp_camera_get_config(camera, &w, ctx->context)) < GP_OK)
		throw Exception("gp_camera_get_config", ret);

	return Widget(w, *this);
}
Example #15
0
void Plugin::hookTabIsRemoving (IHookProxy_ptr, int index, int windowId)
{
    if (!Mgrs_)
        return;

    const auto rootWM = Proxy_->GetRootWindowsManager ();
    const auto tabWidget = rootWM->GetTabWidget (windowId);
    const auto widget = tabWidget->Widget (index);

    Mgrs_->UncloseMgr_.HandleRemoveTab (widget);
    Mgrs_->SessionsMgr_.handleRemoveTab (widget);
}
Example #16
0
// Get the PID from the selection list in CLIENT_DATA
static int get_pid(Widget, XtPointer client_data, XtPointer)
{
    IntArray pids;
    Widget processes = Widget(client_data);
    if (processes != 0)
	getPIDs(processes, pids);

    if (pids.size() == 1)
	return pids[0];
    else
	return 0;
}
Example #17
0
// Get the item from the selection list in CLIENT_DATA
static string get_item(Widget, XtPointer client_data, XtPointer)
{
    StringArray itemids;
    Widget items = Widget(client_data);
    if (items != 0)
	get_items(items, itemids);

    if (itemids.size() == 1)
	return itemids[0];

    return "";
}
Example #18
0
const Widget Camera::config() const {
    std::lock_guard<std::mutex> cg(configmutex);
    std::lock_guard<std::mutex> g(mutex);

	CameraWidget *w;
	int ret;
	if ((ret = gp_camera_get_config(camera, &w, ctx->context)) < GP_OK)
		throw Exception("gp_camera_get_config", ret);

	// FIXME: dirty cast, make const Widget do magic
	return Widget(w, const_cast<gp::Camera&>(*this));
}
Example #19
0
	void Plugin::hookTabIsRemoving (IHookProxy_ptr, int index, int windowId)
	{
		if (Proxy_->IsShuttingDown ())
			return;

		const auto rootWM = Proxy_->GetRootWindowsManager ();
		const auto tabWidget = rootWM->GetTabWidget (windowId);
		const auto widget = tabWidget->Widget (index);

		UncloseMgr_->HandleRemoveTab (widget);
		SessionsMgr_->handleRemoveTab (widget);
	}
Example #20
0
	void Plugin::checkPinState (int windowId, int index)
	{
		auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId);
		if (!tw ||
				tw->WidgetCount () <= index)
			return;

		bool isPinned = tw->Widget (index)->
				property ("SessionData/org.LeechCraft.PinTab.PinState").toBool ();

		if (isPinned)
			pinTab (index);
	}
// Unmanage specific widget
void UnmanageThisCB(Widget, XtPointer client_data, XtPointer)
{
    Widget w = Widget(client_data);

    Widget shell = w;
    if (!XtIsShell(shell))
	shell = XtParent(shell);

    if (shell != 0 && XtIsShell(shell) && !XmIsDialogShell(shell))
	XtPopdown(shell);

    XtUnmanageChild(w);
}
static void PannerCB(Widget /* panner */,
		     XtPointer client_data, 
		     XtPointer call_data)
{
    // Setup porthole after change in panner

    Arg args[2];
    int arg = 0;
    XawPannerReport *report = (XawPannerReport *)call_data;
    Widget graph_edit = Widget(client_data);

    XtSetArg (args[arg], XtNx, -report->slider_x); arg++;
    XtSetArg (args[arg], XtNy, -report->slider_y); arg++;
    XtSetValues(graph_edit, args, arg);
}
Example #23
0
// OK pressed in `Lookup Source'
static void lookupSourceDone(Widget w,
			     XtPointer client_data, 
			     XtPointer call_data)
{
    Widget sources = Widget(client_data);
    XmSelectionBoxCallbackStruct *cbs = 
	(XmSelectionBoxCallbackStruct *)call_data;

    set_status("");

    string source = get_item(w, client_data, call_data);

    if (source.contains('/'))
    {
	// Expand to full path name
	int *position_list = 0;
	int position_count = 0;
	if (XmListGetSelectedPos(sources, &position_list, &position_count))
	{
	    if (position_count == 1)
	    {
		int pos = position_list[0];
		pos--;
		if (pos < 0)
		    pos = all_sources.size() - 1;
		source = all_sources[pos];
	    }

	    XtFree((char *)position_list);
	}
    }

    if (!source.empty())
    {
	source_view->lookup(source + ":1");

	if (cbs != 0 && 
	    cbs->reason != XmCR_APPLY && 
	    cbs->reason != XmCR_ACTIVATE)
	{
	    Widget scroll = XtParent(sources);
	    Widget dialog = XtParent(scroll);
	    XtUnmanageChild(dialog);
	}
    }
}
void
WidgetDir::BuildWindow()
{
	// Create the window
	JXWindow* window = jnew JXWindow(this, 300,200, "Test Widget Program");
	assert( window != NULL );

	// Set sizing
	window->SetMinSize(300,200);
	window->SetMaxSize(800,600);

	// Create our custom widget
	Widget* widget =
		jnew Widget(window, JXWidget::kHElastic, JXWidget::kVElastic,
			0, 0, 300, 200);
	assert( widget != NULL );
}
Example #25
0
void Delay::register_shell(Widget widget)
{
    assert(delays.size() == _shells.size());

    // Check if the shell is already registered
    int i;
    for (i = 0; i < _shells.size(); i++)
	if (_shells[i] == widget)
	    return;

    // Look for an empty slot
    for (i = 0; i < _shells.size() && _shells[i] != 0; i++)
	;

    XtAddCallback(widget, XtNdestroyCallback, DestroyCB, XtPointer(0));

    _Delay *new_delay = 0;
    if (delay_count)
	new_delay = new _Delay(widget);

    if (i == _shells.size())
    {
	_shells += Widget(0);
	delays  += (_Delay *)0;
    }

    assert(_shells[i] == 0);
    assert(delays[i] == 0);
    
    _shells[i] = widget;
    delays[i]  = new_delay;

#if LOG_DELAY
    std::clog << "Registering " << XtName(widget) << " in slot " << i << "\n";
#endif

    if (shell_registered != 0)
	shell_registered(widget);

    assert(delays.size() == _shells.size());
}
Example #26
0
void AAvatar::ToggleInventory()
{
  APlayerController* p_controller = GetWorld()->GetFirstPlayerController();
  ANPC_HUD* hud = Cast<ANPC_HUD>(p_controller->GetHUD());
  
  if (inventory_showing) {
    hud->ClearWidgets();
    inventory_showing = false;
    p_controller->bShowMouseCursor = false;
    return;
  }
  
  inventory_showing = true;
  p_controller->bShowMouseCursor = true;
  for (TMap<FString, int>::TIterator it = backpack.CreateIterator(); it; ++it) {
    FString fs = it->Key + FString::Printf(TEXT(" x %d"), it->Value);
    UTexture2D* tex;
    if (icons.Find(it->Key)) {
      tex = icons[it->Key];
      hud->AddWidget(Widget(Icon(fs, tex)));
    }
  }
}
Example #27
0
	RSEL_DISPLAY,     ///< Display the ride type.
	RSEL_SELECT,      ///< 'select ride type' button.
};

/** Widgets of the select bar. */
static const WidgetNumber _ride_type_select_bar[] = {RSEL_SHOPS, RSEL_GENTLE, RSEL_WET, RSEL_COASTER, INVALID_WIDGET_INDEX};
assert_compile(lengthof(_ride_type_select_bar) == RTK_RIDE_KIND_COUNT + 1); ///< Select bar should have all ride types.

/**
 * Widget description of the ride selection gui.
 * @ingroup gui_group
 */
static const WidgetPart _ride_select_gui_parts[] = {
	Intermediate(0, 1),
		Intermediate(1, 0),
			Widget(WT_TITLEBAR, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), SetData(GUI_RIDE_SELECT_TITLE, GUI_TITLEBAR_TIP),
			Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN),
		EndContainer(),
		/* Ride types bar. */
		Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN),
			Intermediate(2, 1),
				Intermediate(1, 0),
					Widget(WT_LEFT_FILLER_TAB, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN),
					Widget(WT_TEXT_TAB, RSEL_SHOPS, COL_RANGE_DARK_GREEN),
							SetData(GUI_RIDE_SELECT_SHOPS, GUI_RIDE_SELECT_SHOPS_TOOLTIP),
					Widget(WT_TEXT_TAB, RSEL_GENTLE, COL_RANGE_DARK_GREEN),
							SetData(GUI_RIDE_SELECT_GENTLE, GUI_RIDE_SELECT_GENTLE_TOOLTIP),
					Widget(WT_TEXT_TAB, RSEL_WET, COL_RANGE_DARK_GREEN),
							SetData(GUI_RIDE_SELECT_WET, GUI_RIDE_SELECT_WET_TOOLTIP),
					Widget(WT_TEXT_TAB, RSEL_COASTER, COL_RANGE_DARK_GREEN),
							SetData(GUI_RIDE_SELECT_COASTER, GUI_RIDE_SELECT_COASTER_TOOLTIP),
Example #28
0
int wxMessageDialog::ShowModal()
{
    Widget (*dialogCreateFunction)(Widget, String, ArgList, Cardinal) = NULL;
    const long style = GetMessageDialogStyle();

    if ( style & wxYES_NO )
    {
        // if we have [Yes], it must be a question
        dialogCreateFunction = XmCreateQuestionDialog;
    }
    else if ( style & wxICON_STOP )
    {
        // error dialog is the one with error icon...
        dialogCreateFunction = XmCreateErrorDialog;
    }
    else if ( style & wxICON_EXCLAMATION )
    {
        // ...and the warning dialog too
        dialogCreateFunction = XmCreateWarningDialog;
    }
    else
    {
        // finally, use the info dialog by default
        dialogCreateFunction = XmCreateInformationDialog;
    }

    Widget wParent = m_parent ? GetWidget(m_parent) : (Widget) 0;
    if ( !wParent )
    {
        wxWindow *window = wxTheApp->GetTopWindow();
        if ( !window )
        {
            wxFAIL_MSG("can't show message box without parent window");

            return wxID_CANCEL;
        }

        wParent = GetWidget(window);
    }

    // prepare the arg list
    Arg args[10];
    int ac = 0;

    wxXmString text(m_message);
    wxXmString title(m_caption);
    XtSetArg(args[ac], XmNmessageString, text());
    ac++;
    XtSetArg(args[ac], XmNdialogTitle, title());
    ac++;

    wxComputeColours (XtDisplay(wParent), & m_backgroundColour,
                      (wxColour*) NULL);

    XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel);
    ac++;
    XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel);
    ac++;
    XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel);
    ac++;
    XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel);
    ac++;

    // do create message box

    Widget wMsgBox = (*dialogCreateFunction)(wParent, "", args, ac);

    wxCHECK_MSG( wMsgBox, wxID_CANCEL, "msg box creation failed" );

    // get the buttons which we might either remove or rename
    // depending on the requested style
    //
    Widget wBtnOk = XmMessageBoxGetChild(wMsgBox, XmDIALOG_OK_BUTTON);
    Widget wBtnHelp = XmMessageBoxGetChild(wMsgBox, XmDIALOG_HELP_BUTTON);
    Widget wBtnCancel = XmMessageBoxGetChild(wMsgBox, XmDIALOG_CANCEL_BUTTON);

    if ( style & wxYES_NO )
    {
        wxXmString yes(_("Yes")), no(_("No")), cancel(_("Cancel"));

        if ( style & wxCANCEL )
        {
            // use the cancel button for No and the help button for
            // Cancel  Yuk :-)  MB
            //
            XtVaSetValues(wBtnOk, XmNlabelString, yes(), NULL);
            XtVaSetValues(wBtnCancel, XmNlabelString, no(), NULL);
            XtVaSetValues(wBtnHelp, XmNlabelString, cancel(), NULL);
        }
        else
        {
            // no cancel button requested...
            // remove the help button and use cancel for no
            //
            XtVaSetValues(wBtnCancel, XmNlabelString, no(), NULL);
            XtUnmanageChild(wBtnHelp);
        }
    }
    else
    {
        // remove the help button and the cancel button (unless it was
        // requested)
        //
        XtUnmanageChild(wBtnHelp);
        if ( !(style & wxCANCEL ) ) XtUnmanageChild(wBtnCancel);
    }

    // set the callbacks for the message box buttons
    XtAddCallback(wMsgBox, XmNokCallback,
                  (XtCallbackProc)msgboxCallBackOk, (XtPointer)this);
    XtAddCallback(wMsgBox, XmNcancelCallback,
                  (XtCallbackProc)msgboxCallBackCancel, (XtPointer)this);
    XtAddCallback(wMsgBox, XmNhelpCallback,
                  (XtCallbackProc)msgboxCallBackHelp, (XtPointer)this);
    XtAddCallback(wMsgBox, XmNunmapCallback,
                  (XtCallbackProc)msgboxCallBackClose, (XtPointer)this);

    // show it as a modal dialog
    XtManageChild(wMsgBox);
    XtAddGrab(wMsgBox, True, False);

    // the m_result will be changed when message box goes away
    m_result = -1;

    // local message loop
    XtAppContext context = XtWidgetToApplicationContext(wParent);
    XEvent event;
    while ( m_result == -1 )
    {
        XtAppNextEvent(context, &event);
        XtDispatchEvent(&event);
    }

    // translate the result if necessary
    if ( style & wxYES_NO )
    {
        if ( m_result == wxID_OK )
            m_result = wxID_YES;
        else if ( m_result == wxID_CANCEL )
            m_result = wxID_NO;
        else if ( m_result == wxID_HELP )
            m_result = wxID_CANCEL;
    }

    return m_result;
}
Example #29
0
enum GuestInfoWidgets {
	GIW_TITLEBAR,     ///< Title bar widget.
	GIW_MONEY,        ///< Current amount of money.
	GIW_MONEY_SPENT,  ///< Total amount of money spent.
	GIW_HAPPINESS,    ///< Happiness level.
	GIW_ITEMS,        ///< List of carried items.
	GIW_HUNGER_LEVEL, ///< Amount of hunger.
	GIW_THIRST_LEVEL, ///< Amount of thirst.
	GIW_WASTE_LEVEL,  ///< Amount of food/drink waste.
};

/** Widget parts of the #GuestInfoWindow. */
static const WidgetPart _guest_info_gui_parts[] = {
	Intermediate(0, 1),
		Intermediate(1, 0),
			Widget(WT_TITLEBAR, GIW_TITLEBAR, COL_RANGE_DARK_RED), SetData(STR_ARG1, GUI_TITLEBAR_TIP),
			Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED),
		EndContainer(),
		Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED),
			Intermediate(7, 2), SetPadding(2, 2, 2, 2),
				Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_MONEY, STR_NULL),
				Widget(WT_RIGHT_TEXT, GIW_MONEY, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL),

				Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_MONEY_SPENT, STR_NULL),
				Widget(WT_RIGHT_TEXT, GIW_MONEY_SPENT, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL),

				Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_HAPPINESS, STR_NULL),
				Widget(WT_RIGHT_TEXT, GIW_HAPPINESS, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL),

				Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_HUNGER, STR_NULL),
				Widget(WT_RIGHT_TEXT, GIW_HUNGER_LEVEL, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL),
Example #30
0
	PATH_GUI_DIRECTIONAL,  ///< Build a path using the path build interface.
};

static const int SPR_NE_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_NE; ///< Sprite for building in NE direction.
static const int SPR_SE_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_SE; ///< Sprite for building in SE direction.
static const int SPR_SW_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_SW; ///< Sprite for building in SW direction.
static const int SPR_NW_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_NW; ///< Sprite for building in NW direction.

/**
 * Widget parts of the path build GUI.
 * @ingroup gui_group
 */
static const WidgetPart _path_build_gui_parts[] = {
	Intermediate(0, 1),
		Intermediate(1, 0),
			Widget(WT_TITLEBAR, INVALID_WIDGET_INDEX, COL_RANGE_GREY), SetData(GUI_PATH_GUI_TITLE, GUI_TITLEBAR_TIP),
			Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_GREY),
		EndContainer(),
		Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_GREY),
			Intermediate(0, 1),
				Intermediate(1, 5), SetPadding(5, 5, 0, 5),
					Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_INVALID), SetFill(1, 0),
					/* Slope down/level/up. */
					Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_DOWN, COL_RANGE_GREY),
							SetData(SPR_GUI_SLOPES_START + TSL_DOWN, GUI_PATH_GUI_SLOPE_DOWN_TIP),
					Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_FLAT, COL_RANGE_GREY), SetPadding(0, 0, 0, 5),
							SetData(SPR_GUI_SLOPES_START + TSL_FLAT, GUI_PATH_GUI_SLOPE_FLAT_TIP),
					Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_UP, COL_RANGE_GREY), SetPadding(0, 0, 0, 5),
							SetData(SPR_GUI_SLOPES_START + TSL_UP, GUI_PATH_GUI_SLOPE_UP_TIP),
					Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_INVALID), SetFill(1, 0),
				Intermediate(1, 3), SetPadding(5, 5, 0, 5),