|
@@ -9,35 +9,28 @@
|
|
|
|
|
|
/** @file date_gui.cpp Graphical selection of a date. */
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "date_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "window_gui.h"
|
|
|
#include "date_gui.h"
|
|
|
#include "core/geometry_func.hpp"
|
|
|
|
|
|
#include "widgets/dropdown_type.h"
|
|
|
#include "widgets/date_widget.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
|
/** Widgets used by the date window */
|
|
|
enum SetDateWidgets {
|
|
|
SDW_DAY, ///< Dropdown for the day
|
|
|
SDW_MONTH, ///< Dropdown for the month
|
|
|
SDW_YEAR, ///< Dropdown for the year
|
|
|
SDW_SET_DATE, ///< Actually set the date
|
|
|
};
|
|
|
|
|
|
/** Window to select a date graphically by using dropdowns */
|
|
|
struct SetDateWindow : Window {
|
|
|
SetDateCallback *callback; ///< Callback to call when a date has been selected
|
|
|
YearMonthDay date; ///< The currently selected date
|
|
|
Year min_year; ///< The minimum year in the year dropdown
|
|
|
Year max_year; ///< The maximum year (inclusive) in the year dropdown
|
|
|
|
|
|
/**
|
|
|
* Create the new 'set date' window
|
|
|
* @param desc the window description
|
|
|
* @param window_number number of the window
|
|
|
* @param parent the parent window, i.e. if this closes we should close too
|