mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r23544) -Codechange: document and rename widgets to be consistent and understandable
This commit is contained in:
parent
5f74999799
commit
4c344a82a9
@ -66,7 +66,7 @@ public:
|
||||
/** Nested widgets for the download window. */
|
||||
static const NWidgetPart _nested_boostrap_download_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, NCDSWW_BACKGROUND),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30),
|
||||
EndContainer(),
|
||||
};
|
||||
|
@ -293,16 +293,16 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
MusicTrackSelectionWindow(const WindowDesc *desc, WindowNumber number) : Window()
|
||||
{
|
||||
this->InitNested(desc, number);
|
||||
this->LowerWidget(MTSW_LIST_LEFT);
|
||||
this->LowerWidget(MTSW_LIST_RIGHT);
|
||||
this->SetWidgetDisabledState(MTSW_CLEAR, _settings_client.music.playlist <= 3);
|
||||
this->LowerWidget(MTSW_ALL + _settings_client.music.playlist);
|
||||
this->LowerWidget(WID_MTS_LIST_LEFT);
|
||||
this->LowerWidget(WID_MTS_LIST_RIGHT);
|
||||
this->SetWidgetDisabledState(WID_MTS_CLEAR, _settings_client.music.playlist <= 3);
|
||||
this->LowerWidget(WID_MTS_ALL + _settings_client.music.playlist);
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
{
|
||||
switch (widget) {
|
||||
case MTSW_PLAYLIST:
|
||||
case WID_MTS_PLAYLIST:
|
||||
SetDParam(0, STR_MUSIC_PLAYLIST_ALL + _settings_client.music.playlist);
|
||||
break;
|
||||
}
|
||||
@ -317,16 +317,16 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
this->SetWidgetLoweredState(MTSW_ALL + i, i == _settings_client.music.playlist);
|
||||
this->SetWidgetLoweredState(WID_MTS_ALL + i, i == _settings_client.music.playlist);
|
||||
}
|
||||
this->SetWidgetDisabledState(MTSW_CLEAR, _settings_client.music.playlist <= 3);
|
||||
this->SetWidgetDisabledState(WID_MTS_CLEAR, _settings_client.music.playlist <= 3);
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
||||
{
|
||||
switch (widget) {
|
||||
case MTSW_PLAYLIST: {
|
||||
case WID_MTS_PLAYLIST: {
|
||||
Dimension d = {0, 0};
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
@ -339,7 +339,7 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MTSW_LIST_LEFT: case MTSW_LIST_RIGHT: {
|
||||
case WID_MTS_LIST_LEFT: case WID_MTS_LIST_RIGHT: {
|
||||
Dimension d = {0, 0};
|
||||
|
||||
for (uint i = 0; i < NUM_SONGS_AVAILABLE; i++) {
|
||||
@ -364,7 +364,7 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
switch (widget) {
|
||||
case MTSW_LIST_LEFT: {
|
||||
case WID_MTS_LIST_LEFT: {
|
||||
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
|
||||
|
||||
int y = r.top + WD_FRAMERECT_TOP;
|
||||
@ -381,7 +381,7 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MTSW_LIST_RIGHT: {
|
||||
case WID_MTS_LIST_RIGHT: {
|
||||
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
|
||||
|
||||
int y = r.top + WD_FRAMERECT_TOP;
|
||||
@ -401,7 +401,7 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
{
|
||||
switch (widget) {
|
||||
case MTSW_LIST_LEFT: { // add to playlist
|
||||
case WID_MTS_LIST_LEFT: { // add to playlist
|
||||
int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
|
||||
|
||||
if (_settings_client.music.playlist < 4) return;
|
||||
@ -426,7 +426,7 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MTSW_LIST_RIGHT: { // remove from playlist
|
||||
case WID_MTS_LIST_RIGHT: { // remove from playlist
|
||||
int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
|
||||
|
||||
if (_settings_client.music.playlist < 4) return;
|
||||
@ -442,16 +442,16 @@ struct MusicTrackSelectionWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MTSW_CLEAR: // clear
|
||||
case WID_MTS_CLEAR: // clear
|
||||
for (uint i = 0; _playlists[_settings_client.music.playlist][i] != 0; i++) _playlists[_settings_client.music.playlist][i] = 0;
|
||||
this->SetDirty();
|
||||
StopMusic();
|
||||
SelectSongToPlay();
|
||||
break;
|
||||
|
||||
case MTSW_ALL: case MTSW_OLD: case MTSW_NEW:
|
||||
case MTSW_EZY: case MTSW_CUSTOM1: case MTSW_CUSTOM2: // set playlist
|
||||
SelectPlaylist(widget - MTSW_ALL);
|
||||
case WID_MTS_ALL: case WID_MTS_OLD: case WID_MTS_NEW:
|
||||
case WID_MTS_EZY: case WID_MTS_CUSTOM1: case WID_MTS_CUSTOM2: // set playlist
|
||||
SelectPlaylist(widget - WID_MTS_ALL);
|
||||
StopMusic();
|
||||
SelectSongToPlay();
|
||||
break;
|
||||
@ -469,26 +469,26 @@ static const NWidgetPart _nested_music_track_selection_widgets[] = {
|
||||
/* Left panel. */
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY), SetDataTip(STR_PLAYLIST_TRACK_INDEX, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MTSW_LIST_LEFT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK), EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_MTS_LIST_LEFT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK), EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
||||
EndContainer(),
|
||||
/* Middle buttons. */
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(60, 30), // Space above the first button from the title bar.
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_ALL), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_ALL, STR_MUSIC_TOOLTIP_SELECT_ALL_TRACKS_PROGRAM),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_OLD), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_OLD_STYLE, STR_MUSIC_TOOLTIP_SELECT_OLD_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_NEW), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_NEW_STYLE, STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_EZY), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_EZY_STREET, STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_CUSTOM1), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_1, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MTSW_CUSTOM2), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_ALL), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_ALL, STR_MUSIC_TOOLTIP_SELECT_ALL_TRACKS_PROGRAM),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_OLD), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_OLD_STYLE, STR_MUSIC_TOOLTIP_SELECT_OLD_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_NEW), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_NEW_STYLE, STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_EZY), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_EZY_STREET, STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_CUSTOM1), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_1, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_MTS_CUSTOM2), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 16), // Space above 'clear' button
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, MTSW_CLEAR), SetFill(1, 0), SetDataTip(STR_PLAYLIST_CLEAR, STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_MTS_CLEAR), SetFill(1, 0), SetDataTip(STR_PLAYLIST_CLEAR, STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1),
|
||||
NWidget(NWID_SPACER), SetFill(0, 1),
|
||||
EndContainer(),
|
||||
/* Right panel. */
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, MTSW_PLAYLIST), SetDataTip(STR_PLAYLIST_PROGRAM, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MTSW_LIST_RIGHT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK), EndContainer(),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, WID_MTS_PLAYLIST), SetDataTip(STR_PLAYLIST_PROGRAM, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_MTS_LIST_RIGHT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK), EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
@ -513,17 +513,17 @@ struct MusicWindow : public Window {
|
||||
MusicWindow(const WindowDesc *desc, WindowNumber number) : Window()
|
||||
{
|
||||
this->InitNested(desc, number);
|
||||
this->LowerWidget(_settings_client.music.playlist + MW_ALL);
|
||||
this->SetWidgetLoweredState(MW_SHUFFLE, _settings_client.music.shuffle);
|
||||
this->LowerWidget(_settings_client.music.playlist + WID_M_ALL);
|
||||
this->SetWidgetLoweredState(WID_M_SHUFFLE, _settings_client.music.shuffle);
|
||||
}
|
||||
|
||||
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
||||
{
|
||||
switch (widget) {
|
||||
/* Make sure that MW_SHUFFLE and MW_PROGRAMME have the same size.
|
||||
* This can't be done by using NC_EQUALSIZE as the MW_INFO is
|
||||
/* Make sure that WID_M_SHUFFLE and WID_M_PROGRAMME have the same size.
|
||||
* This can't be done by using NC_EQUALSIZE as the WID_M_INFO is
|
||||
* between those widgets and of different size. */
|
||||
case MW_SHUFFLE: case MW_PROGRAMME: {
|
||||
case WID_M_SHUFFLE: case WID_M_PROGRAMME: {
|
||||
Dimension d = maxdim(GetStringBoundingBox(STR_MUSIC_PROGRAM), GetStringBoundingBox(STR_MUSIC_SHUFFLE));
|
||||
d.width += padding.width;
|
||||
d.height += padding.height;
|
||||
@ -531,7 +531,7 @@ struct MusicWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MW_TRACK_NR: {
|
||||
case WID_M_TRACK_NR: {
|
||||
Dimension d = GetStringBoundingBox(STR_MUSIC_TRACK_NONE);
|
||||
d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
||||
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||
@ -539,7 +539,7 @@ struct MusicWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MW_TRACK_NAME: {
|
||||
case WID_M_TRACK_NAME: {
|
||||
Dimension d = GetStringBoundingBox(STR_MUSIC_TITLE_NONE);
|
||||
for (uint i = 0; i < NUM_SONGS_AVAILABLE; i++) {
|
||||
SetDParamStr(0, GetSongName(i));
|
||||
@ -553,16 +553,16 @@ struct MusicWindow : public Window {
|
||||
|
||||
/* Hack-ish: set the proper widget data; only needs to be done once
|
||||
* per (Re)Init as that's the only time the language changes. */
|
||||
case MW_PREV: this->GetWidget<NWidgetCore>(MW_PREV)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_SKIP_TO_NEXT : SPR_IMG_SKIP_TO_PREV; break;
|
||||
case MW_NEXT: this->GetWidget<NWidgetCore>(MW_NEXT)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_SKIP_TO_PREV : SPR_IMG_SKIP_TO_NEXT; break;
|
||||
case MW_PLAY: this->GetWidget<NWidgetCore>(MW_PLAY)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_PLAY_MUSIC_RTL : SPR_IMG_PLAY_MUSIC; break;
|
||||
case WID_M_PREV: this->GetWidget<NWidgetCore>(WID_M_PREV)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_SKIP_TO_NEXT : SPR_IMG_SKIP_TO_PREV; break;
|
||||
case WID_M_NEXT: this->GetWidget<NWidgetCore>(WID_M_NEXT)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_SKIP_TO_PREV : SPR_IMG_SKIP_TO_NEXT; break;
|
||||
case WID_M_PLAY: this->GetWidget<NWidgetCore>(WID_M_PLAY)->widget_data = _current_text_dir == TD_RTL ? SPR_IMG_PLAY_MUSIC_RTL : SPR_IMG_PLAY_MUSIC; break;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
switch (widget) {
|
||||
case MW_TRACK_NR: {
|
||||
case WID_M_TRACK_NR: {
|
||||
GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK);
|
||||
StringID str = STR_MUSIC_TRACK_NONE;
|
||||
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
||||
@ -574,7 +574,7 @@ struct MusicWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MW_TRACK_NAME: {
|
||||
case WID_M_TRACK_NAME: {
|
||||
GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, PC_BLACK);
|
||||
StringID str = STR_MUSIC_TITLE_NONE;
|
||||
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
||||
@ -585,9 +585,9 @@ struct MusicWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MW_MUSIC_VOL: case MW_EFFECT_VOL: {
|
||||
case WID_M_MUSIC_VOL: case WID_M_EFFECT_VOL: {
|
||||
DrawFrameRect(r.left, r.top + 2, r.right, r.bottom - 2, COLOUR_GREY, FR_LOWERED);
|
||||
byte volume = (widget == MW_MUSIC_VOL) ? _settings_client.music.music_vol : _settings_client.music.effect_vol;
|
||||
byte volume = (widget == WID_M_MUSIC_VOL) ? _settings_client.music.music_vol : _settings_client.music.effect_vol;
|
||||
int x = (volume * (r.right - r.left) / 127);
|
||||
if (_current_text_dir == TD_RTL) {
|
||||
x = r.right - x;
|
||||
@ -609,7 +609,7 @@ struct MusicWindow : public Window {
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
this->SetWidgetLoweredState(MW_ALL + i, i == _settings_client.music.playlist);
|
||||
this->SetWidgetLoweredState(WID_M_ALL + i, i == _settings_client.music.playlist);
|
||||
}
|
||||
this->SetDirty();
|
||||
}
|
||||
@ -617,36 +617,36 @@ struct MusicWindow : public Window {
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
{
|
||||
switch (widget) {
|
||||
case MW_PREV: // skip to prev
|
||||
case WID_M_PREV: // skip to prev
|
||||
if (!_song_is_active) return;
|
||||
SkipToPrevSong();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
||||
case MW_NEXT: // skip to next
|
||||
case WID_M_NEXT: // skip to next
|
||||
if (!_song_is_active) return;
|
||||
SkipToNextSong();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
||||
case MW_STOP: // stop playing
|
||||
case WID_M_STOP: // stop playing
|
||||
_settings_client.music.playing = false;
|
||||
break;
|
||||
|
||||
case MW_PLAY: // start playing
|
||||
case WID_M_PLAY: // start playing
|
||||
_settings_client.music.playing = true;
|
||||
break;
|
||||
|
||||
case MW_MUSIC_VOL: case MW_EFFECT_VOL: { // volume sliders
|
||||
case WID_M_MUSIC_VOL: case WID_M_EFFECT_VOL: { // volume sliders
|
||||
int x = pt.x - this->GetWidget<NWidgetBase>(widget)->pos_x;
|
||||
|
||||
byte *vol = (widget == MW_MUSIC_VOL) ? &_settings_client.music.music_vol : &_settings_client.music.effect_vol;
|
||||
byte *vol = (widget == WID_M_MUSIC_VOL) ? &_settings_client.music.music_vol : &_settings_client.music.effect_vol;
|
||||
|
||||
byte new_vol = x * 127 / this->GetWidget<NWidgetBase>(widget)->current_x;
|
||||
if (_current_text_dir == TD_RTL) new_vol = 127 - new_vol;
|
||||
if (new_vol != *vol) {
|
||||
*vol = new_vol;
|
||||
if (widget == MW_MUSIC_VOL) MusicVolumeChanged(new_vol);
|
||||
if (widget == WID_M_MUSIC_VOL) MusicVolumeChanged(new_vol);
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
@ -654,22 +654,22 @@ struct MusicWindow : public Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case MW_SHUFFLE: // toggle shuffle
|
||||
case WID_M_SHUFFLE: // toggle shuffle
|
||||
_settings_client.music.shuffle ^= 1;
|
||||
this->SetWidgetLoweredState(MW_SHUFFLE, _settings_client.music.shuffle);
|
||||
this->SetWidgetDirty(MW_SHUFFLE);
|
||||
this->SetWidgetLoweredState(WID_M_SHUFFLE, _settings_client.music.shuffle);
|
||||
this->SetWidgetDirty(WID_M_SHUFFLE);
|
||||
StopMusic();
|
||||
SelectSongToPlay();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
||||
case MW_PROGRAMME: // show track selection
|
||||
case WID_M_PROGRAMME: // show track selection
|
||||
ShowMusicTrackSelection();
|
||||
break;
|
||||
|
||||
case MW_ALL: case MW_OLD: case MW_NEW:
|
||||
case MW_EZY: case MW_CUSTOM1: case MW_CUSTOM2: // playlist
|
||||
SelectPlaylist(widget - MW_ALL);
|
||||
case WID_M_ALL: case WID_M_OLD: case WID_M_NEW:
|
||||
case WID_M_EZY: case WID_M_CUSTOM1: case WID_M_CUSTOM2: // playlist
|
||||
SelectPlaylist(widget - WID_M_ALL);
|
||||
StopMusic();
|
||||
SelectSongToPlay();
|
||||
this->SetDirty();
|
||||
@ -688,18 +688,18 @@ static const NWidgetPart _nested_music_window_widgets[] = {
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, -1), SetFill(1, 1), EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_PREV), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_PREV, STR_MUSIC_TOOLTIP_SKIP_TO_PREVIOUS_TRACK),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_NEXT), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_NEXT, STR_MUSIC_TOOLTIP_SKIP_TO_NEXT_TRACK_IN_SELECTION),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_STOP), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_STOP_MUSIC, STR_MUSIC_TOOLTIP_STOP_PLAYING_MUSIC),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, MW_PLAY), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_PLAY_MUSIC, STR_MUSIC_TOOLTIP_START_PLAYING_MUSIC),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_M_PREV), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_PREV, STR_MUSIC_TOOLTIP_SKIP_TO_PREVIOUS_TRACK),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_M_NEXT), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_SKIP_TO_NEXT, STR_MUSIC_TOOLTIP_SKIP_TO_NEXT_TRACK_IN_SELECTION),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_M_STOP), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_STOP_MUSIC, STR_MUSIC_TOOLTIP_STOP_PLAYING_MUSIC),
|
||||
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_M_PLAY), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_PLAY_MUSIC, STR_MUSIC_TOOLTIP_START_PLAYING_MUSIC),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, -1), SetFill(1, 1), EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MW_SLIDERS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_M_SLIDERS),
|
||||
NWidget(NWID_HORIZONTAL), SetPIP(20, 20, 20),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetFill(1, 0), SetDataTip(STR_MUSIC_MUSIC_VOLUME, STR_NULL),
|
||||
NWidget(WWT_EMPTY, COLOUR_GREY, MW_MUSIC_VOL), SetMinimalSize(67, 0), SetMinimalTextLines(1, 0), SetFill(1, 0), SetDataTip(0x0, STR_MUSIC_TOOLTIP_DRAG_SLIDERS_TO_SET_MUSIC),
|
||||
NWidget(WWT_EMPTY, COLOUR_GREY, WID_M_MUSIC_VOL), SetMinimalSize(67, 0), SetMinimalTextLines(1, 0), SetFill(1, 0), SetDataTip(0x0, STR_MUSIC_TOOLTIP_DRAG_SLIDERS_TO_SET_MUSIC),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetDataTip(STR_MUSIC_RULER_MIN, STR_NULL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetDataTip(STR_MUSIC_RULER_MARKER, STR_NULL), SetFill(1, 0),
|
||||
@ -712,7 +712,7 @@ static const NWidgetPart _nested_music_window_widgets[] = {
|
||||
EndContainer(),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetFill(1, 0), SetDataTip(STR_MUSIC_EFFECTS_VOLUME, STR_NULL),
|
||||
NWidget(WWT_EMPTY, COLOUR_GREY, MW_EFFECT_VOL), SetMinimalSize(67, 0), SetMinimalTextLines(1, 0), SetFill(1, 0), SetDataTip(0x0, STR_MUSIC_TOOLTIP_DRAG_SLIDERS_TO_SET_MUSIC),
|
||||
NWidget(WWT_EMPTY, COLOUR_GREY, WID_M_EFFECT_VOL), SetMinimalSize(67, 0), SetMinimalTextLines(1, 0), SetFill(1, 0), SetDataTip(0x0, STR_MUSIC_TOOLTIP_DRAG_SLIDERS_TO_SET_MUSIC),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetDataTip(STR_MUSIC_RULER_MIN, STR_NULL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, -1), SetDataTip(STR_MUSIC_RULER_MARKER, STR_NULL), SetFill(1, 0),
|
||||
@ -726,35 +726,35 @@ static const NWidgetPart _nested_music_window_widgets[] = {
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MW_BACKGROUND),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_M_BACKGROUND),
|
||||
NWidget(NWID_HORIZONTAL), SetPIP(6, 0, 6),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(NWID_SPACER), SetFill(0, 1),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_SHUFFLE), SetMinimalSize(50, 8), SetDataTip(STR_MUSIC_SHUFFLE, STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_SHUFFLE), SetMinimalSize(50, 8), SetDataTip(STR_MUSIC_SHUFFLE, STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE),
|
||||
NWidget(NWID_SPACER), SetFill(0, 1),
|
||||
EndContainer(),
|
||||
NWidget(NWID_VERTICAL), SetPadding(0, 0, 3, 3),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, MW_TRACK), SetFill(0, 0), SetDataTip(STR_MUSIC_TRACK, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MW_TRACK_NR), EndContainer(),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, WID_M_TRACK), SetFill(0, 0), SetDataTip(STR_MUSIC_TRACK, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_M_TRACK_NR), EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_VERTICAL), SetPadding(0, 3, 3, 0),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, MW_TRACK_TITLE), SetFill(1, 0), SetDataTip(STR_MUSIC_XTITLE, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, MW_TRACK_NAME), SetFill(1, 0), EndContainer(),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, WID_M_TRACK_TITLE), SetFill(1, 0), SetDataTip(STR_MUSIC_XTITLE, STR_NULL),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_M_TRACK_NAME), SetFill(1, 0), EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(NWID_SPACER), SetFill(0, 1),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, MW_PROGRAMME), SetMinimalSize(50, 8), SetDataTip(STR_MUSIC_PROGRAM, STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_M_PROGRAMME), SetMinimalSize(50, 8), SetDataTip(STR_MUSIC_PROGRAM, STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION),
|
||||
NWidget(NWID_SPACER), SetFill(0, 1),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_ALL), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_ALL, STR_MUSIC_TOOLTIP_SELECT_ALL_TRACKS_PROGRAM),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_OLD), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_OLD_STYLE, STR_MUSIC_TOOLTIP_SELECT_OLD_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_NEW), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_NEW_STYLE, STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_EZY), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_EZY_STREET, STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_CUSTOM1), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_1, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_CUSTOM2), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_ALL), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_ALL, STR_MUSIC_TOOLTIP_SELECT_ALL_TRACKS_PROGRAM),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_OLD), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_OLD_STYLE, STR_MUSIC_TOOLTIP_SELECT_OLD_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_NEW), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_NEW_STYLE, STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_EZY), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_EZY_STREET, STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_CUSTOM1), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_1, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_CUSTOM2), SetFill(1, 0), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
|
@ -314,7 +314,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
|
||||
this->InitNested(desc, type);
|
||||
|
||||
this->SetFocusedWidget(NWCW_TEXTBOX);
|
||||
this->SetFocusedWidget(WID_NC_TEXTBOX);
|
||||
InvalidateWindowData(WC_NEWS_WINDOW, 0, this->height);
|
||||
_chat_tab_completion_active = false;
|
||||
|
||||
@ -468,7 +468,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
virtual void OnPaint()
|
||||
{
|
||||
this->DrawWidgets();
|
||||
this->DrawEditBox(NWCW_TEXTBOX);
|
||||
this->DrawEditBox(WID_NC_TEXTBOX);
|
||||
}
|
||||
|
||||
virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
|
||||
@ -479,7 +479,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
|
||||
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
||||
{
|
||||
if (widget != NWCW_DESTINATION) return;
|
||||
if (widget != WID_NC_DESTINATION) return;
|
||||
|
||||
if (this->dtype == DESTTYPE_CLIENT) {
|
||||
SetDParamStr(0, NetworkClientInfo::GetByClientID((ClientID)this->dest)->client_name);
|
||||
@ -492,7 +492,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
if (widget != NWCW_DESTINATION) return;
|
||||
if (widget != WID_NC_DESTINATION) return;
|
||||
|
||||
if (this->dtype == DESTTYPE_CLIENT) {
|
||||
SetDParamStr(0, NetworkClientInfo::GetByClientID((ClientID)this->dest)->client_name);
|
||||
@ -504,15 +504,15 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
{
|
||||
switch (widget) {
|
||||
/* Send */
|
||||
case NWCW_SENDBUTTON: SendChat(this->text.buf, this->dtype, this->dest);
|
||||
case WID_NC_SENDBUTTON: SendChat(this->text.buf, this->dtype, this->dest);
|
||||
/* FALL THROUGH */
|
||||
case NWCW_CLOSE: /* Cancel */ delete this; break;
|
||||
case WID_NC_CLOSE: /* Cancel */ delete this; break;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnMouseLoop()
|
||||
{
|
||||
this->HandleEditBox(NWCW_TEXTBOX);
|
||||
this->HandleEditBox(WID_NC_TEXTBOX);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
@ -523,7 +523,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
state = ES_HANDLED;
|
||||
} else {
|
||||
_chat_tab_completion_active = false;
|
||||
switch (this->HandleEditBoxKey(NWCW_TEXTBOX, key, keycode, state)) {
|
||||
switch (this->HandleEditBoxKey(WID_NC_TEXTBOX, key, keycode, state)) {
|
||||
default: NOT_REACHED();
|
||||
case HEBR_EDITING: {
|
||||
Window *osk = FindWindowById(WC_OSK, 0);
|
||||
@ -542,7 +542,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
|
||||
virtual void OnOpenOSKWindow(int wid)
|
||||
{
|
||||
ShowOnScreenKeyboard(this, wid, NWCW_CLOSE, NWCW_SENDBUTTON);
|
||||
ShowOnScreenKeyboard(this, wid, WID_NC_CLOSE, WID_NC_SENDBUTTON);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -559,13 +559,13 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
|
||||
/** The widgets of the chat window. */
|
||||
static const NWidgetPart _nested_chat_window_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY, NWCW_CLOSE),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, NWCW_BACKGROUND),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY, WID_NC_CLOSE),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_NC_BACKGROUND),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_TEXT, COLOUR_GREY, NWCW_DESTINATION), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NULL, STR_NULL),
|
||||
NWidget(WWT_EDITBOX, COLOUR_GREY, NWCW_TEXTBOX), SetMinimalSize(100, 12), SetPadding(1, 0, 1, 0), SetResize(1, 0),
|
||||
NWidget(WWT_TEXT, COLOUR_GREY, WID_NC_DESTINATION), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NULL, STR_NULL),
|
||||
NWidget(WWT_EDITBOX, COLOUR_GREY, WID_NC_TEXTBOX), SetMinimalSize(100, 12), SetPadding(1, 0, 1, 0), SetResize(1, 0),
|
||||
SetDataTip(STR_NETWORK_CHAT_OSKTITLE, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, NWCW_SENDBUTTON), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NETWORK_CHAT_SEND, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_NC_SENDBUTTON), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NETWORK_CHAT_SEND, STR_NULL),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
|
@ -30,11 +30,11 @@
|
||||
/** Nested widgets for the download window. */
|
||||
static const NWidgetPart _nested_network_content_download_status_window_widgets[] = {
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, NCDSWW_BACKGROUND),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(125, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCDSWW_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCDS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
|
||||
NWidget(NWID_SPACER), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 4),
|
||||
@ -65,7 +65,7 @@ BaseNetworkContentDownloadStatusWindow::~BaseNetworkContentDownloadStatusWindow(
|
||||
|
||||
/* virtual */ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
if (widget != NCDSWW_BACKGROUND) return;
|
||||
if (widget != WID_NCDS_BACKGROUND) return;
|
||||
|
||||
/* Draw nice progress bar :) */
|
||||
DrawFrameRect(r.left + 20, r.top + 4, r.left + 20 + (int)((this->width - 40LL) * this->downloaded_bytes / this->total_bytes), r.top + 14, COLOUR_MAUVE, FR_NONE);
|
||||
@ -198,7 +198,7 @@ public:
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
{
|
||||
if (widget == NCDSWW_CANCELOK) {
|
||||
if (widget == WID_NCDS_CANCELOK) {
|
||||
if (this->downloaded_bytes != this->total_bytes) {
|
||||
_network_content_client.Close();
|
||||
delete this;
|
||||
@ -217,7 +217,7 @@ public:
|
||||
|
||||
/* When downloading is finished change cancel in ok */
|
||||
if (this->downloaded_bytes == this->total_bytes) {
|
||||
this->GetWidget<NWidgetCore>(NCDSWW_CANCELOK)->widget_data = STR_BUTTON_OK;
|
||||
this->GetWidget<NWidgetCore>(WID_NCDS_CANCELOK)->widget_data = STR_BUTTON_OK;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -356,14 +356,14 @@ public:
|
||||
list_pos(0)
|
||||
{
|
||||
this->CreateNestedTree(desc);
|
||||
this->vscroll = this->GetScrollbar(NCLWW_SCROLLBAR);
|
||||
this->vscroll = this->GetScrollbar(WID_NCL_SCROLLBAR);
|
||||
this->FinishInitNested(desc, 1);
|
||||
|
||||
this->GetWidget<NWidgetStacked>(NCLWW_SEL_ALL_UPDATE)->SetDisplayedPlane(select_all);
|
||||
this->GetWidget<NWidgetStacked>(WID_NCL_SEL_ALL_UPDATE)->SetDisplayedPlane(select_all);
|
||||
|
||||
this->afilter = CS_ALPHANUMERAL;
|
||||
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, EDITBOX_MAX_LENGTH);
|
||||
this->SetFocusedWidget(NCLWW_FILTER);
|
||||
this->SetFocusedWidget(WID_NCL_FILTER);
|
||||
|
||||
_network_content_client.AddCallback(this);
|
||||
this->content.SetListing(this->last_sorting);
|
||||
@ -385,11 +385,11 @@ public:
|
||||
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
||||
{
|
||||
switch (widget) {
|
||||
case NCLWW_FILTER_CAPT:
|
||||
case WID_NCL_FILTER_CAPT:
|
||||
*size = maxdim(*size, GetStringBoundingBox(STR_CONTENT_FILTER_TITLE));
|
||||
break;
|
||||
|
||||
case NCLWW_TYPE: {
|
||||
case WID_NCL_TYPE: {
|
||||
Dimension d = *size;
|
||||
for (int i = CONTENT_TYPE_BEGIN; i < CONTENT_TYPE_END; i++) {
|
||||
d = maxdim(d, GetStringBoundingBox(STR_CONTENT_TYPE_BASE_GRAPHICS + i - CONTENT_TYPE_BASE_GRAPHICS));
|
||||
@ -398,7 +398,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
case NCLWW_MATRIX:
|
||||
case WID_NCL_MATRIX:
|
||||
resize->height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
|
||||
size->height = 10 * resize->height;
|
||||
break;
|
||||
@ -409,15 +409,15 @@ public:
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
switch (widget) {
|
||||
case NCLWW_FILTER_CAPT:
|
||||
case WID_NCL_FILTER_CAPT:
|
||||
DrawString(r.left, r.right, r.top, STR_CONTENT_FILTER_TITLE, TC_FROMSTRING, SA_RIGHT);
|
||||
break;
|
||||
|
||||
case NCLWW_DETAILS:
|
||||
case WID_NCL_DETAILS:
|
||||
this->DrawDetails(r);
|
||||
break;
|
||||
|
||||
case NCLWW_MATRIX:
|
||||
case WID_NCL_MATRIX:
|
||||
this->DrawMatrix(r);
|
||||
break;
|
||||
}
|
||||
@ -434,12 +434,12 @@ public:
|
||||
this->DrawWidgets();
|
||||
|
||||
/* Edit box to filter for keywords */
|
||||
this->DrawEditBox(NCLWW_FILTER);
|
||||
this->DrawEditBox(WID_NCL_FILTER);
|
||||
|
||||
switch (this->content.SortType()) {
|
||||
case NCLWW_CHECKBOX - NCLWW_CHECKBOX: this->DrawSortButtonState(NCLWW_CHECKBOX, arrow); break;
|
||||
case NCLWW_TYPE - NCLWW_CHECKBOX: this->DrawSortButtonState(NCLWW_TYPE, arrow); break;
|
||||
case NCLWW_NAME - NCLWW_CHECKBOX: this->DrawSortButtonState(NCLWW_NAME, arrow); break;
|
||||
case WID_NCL_CHECKBOX - WID_NCL_CHECKBOX: this->DrawSortButtonState(WID_NCL_CHECKBOX, arrow); break;
|
||||
case WID_NCL_TYPE - WID_NCL_CHECKBOX: this->DrawSortButtonState(WID_NCL_TYPE, arrow); break;
|
||||
case WID_NCL_NAME - WID_NCL_CHECKBOX: this->DrawSortButtonState(WID_NCL_NAME, arrow); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,9 +449,9 @@ public:
|
||||
*/
|
||||
void DrawMatrix(const Rect &r) const
|
||||
{
|
||||
const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX);
|
||||
const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(NCLWW_NAME);
|
||||
const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(NCLWW_TYPE);
|
||||
const NWidgetBase *nwi_checkbox = this->GetWidget<NWidgetBase>(WID_NCL_CHECKBOX);
|
||||
const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(WID_NCL_NAME);
|
||||
const NWidgetBase *nwi_type = this->GetWidget<NWidgetBase>(WID_NCL_TYPE);
|
||||
|
||||
|
||||
/* Fill the matrix with the information */
|
||||
@ -599,14 +599,14 @@ public:
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
{
|
||||
switch (widget) {
|
||||
case NCLWW_MATRIX: {
|
||||
uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, NCLWW_MATRIX);
|
||||
case WID_NCL_MATRIX: {
|
||||
uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NCL_MATRIX);
|
||||
if (id_v >= this->content.Length()) return; // click out of bounds
|
||||
|
||||
this->selected = *this->content.Get(id_v);
|
||||
this->list_pos = id_v;
|
||||
|
||||
const NWidgetBase *checkbox = this->GetWidget<NWidgetBase>(NCLWW_CHECKBOX);
|
||||
const NWidgetBase *checkbox = this->GetWidget<NWidgetBase>(WID_NCL_CHECKBOX);
|
||||
if (click_count > 1 || IsInsideBS(pt.x, checkbox->pos_x, checkbox->current_x)) {
|
||||
_network_content_client.ToggleSelectedState(this->selected);
|
||||
this->content.ForceResort();
|
||||
@ -616,14 +616,14 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
case NCLWW_CHECKBOX:
|
||||
case NCLWW_TYPE:
|
||||
case NCLWW_NAME:
|
||||
if (this->content.SortType() == widget - NCLWW_CHECKBOX) {
|
||||
case WID_NCL_CHECKBOX:
|
||||
case WID_NCL_TYPE:
|
||||
case WID_NCL_NAME:
|
||||
if (this->content.SortType() == widget - WID_NCL_CHECKBOX) {
|
||||
this->content.ToggleSortOrder();
|
||||
this->list_pos = this->content.Length() - this->list_pos - 1;
|
||||
} else {
|
||||
this->content.SetSortType(widget - NCLWW_CHECKBOX);
|
||||
this->content.SetSortType(widget - WID_NCL_CHECKBOX);
|
||||
this->content.ForceResort();
|
||||
this->SortContentList();
|
||||
}
|
||||
@ -631,33 +631,33 @@ public:
|
||||
this->InvalidateData();
|
||||
break;
|
||||
|
||||
case NCLWW_SELECT_ALL:
|
||||
case WID_NCL_SELECT_ALL:
|
||||
_network_content_client.SelectAll();
|
||||
this->InvalidateData();
|
||||
break;
|
||||
|
||||
case NCLWW_SELECT_UPDATE:
|
||||
case WID_NCL_SELECT_UPDATE:
|
||||
_network_content_client.SelectUpgrade();
|
||||
this->InvalidateData();
|
||||
break;
|
||||
|
||||
case NCLWW_UNSELECT:
|
||||
case WID_NCL_UNSELECT:
|
||||
_network_content_client.UnselectAll();
|
||||
this->InvalidateData();
|
||||
break;
|
||||
|
||||
case NCLWW_CANCEL:
|
||||
case WID_NCL_CANCEL:
|
||||
delete this;
|
||||
break;
|
||||
|
||||
case NCLWW_OPEN_URL:
|
||||
case WID_NCL_OPEN_URL:
|
||||
if (this->selected != NULL) {
|
||||
extern void OpenBrowser(const char *url);
|
||||
OpenBrowser(this->selected->url);
|
||||
}
|
||||
break;
|
||||
|
||||
case NCLWW_DOWNLOAD:
|
||||
case WID_NCL_DOWNLOAD:
|
||||
if (BringWindowToFrontById(WC_NETWORK_STATUS_WINDOW, 0) == NULL) new NetworkContentDownloadStatusWindow();
|
||||
break;
|
||||
}
|
||||
@ -665,7 +665,7 @@ public:
|
||||
|
||||
virtual void OnMouseLoop()
|
||||
{
|
||||
this->HandleEditBox(NCLWW_FILTER);
|
||||
this->HandleEditBox(WID_NCL_FILTER);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
@ -698,7 +698,7 @@ public:
|
||||
|
||||
case WKC_SPACE:
|
||||
case WKC_RETURN:
|
||||
if (keycode == WKC_RETURN || !IsWidgetFocused(NCLWW_FILTER)) {
|
||||
if (keycode == WKC_RETURN || !IsWidgetFocused(WID_NCL_FILTER)) {
|
||||
if (this->selected != NULL) {
|
||||
_network_content_client.ToggleSelectedState(this->selected);
|
||||
this->content.ForceResort();
|
||||
@ -711,8 +711,8 @@ public:
|
||||
default: {
|
||||
/* Handle editbox input */
|
||||
EventState state = ES_NOT_HANDLED;
|
||||
if (this->HandleEditBoxKey(NCLWW_FILTER, key, keycode, state) == HEBR_EDITING) {
|
||||
this->OnOSKInput(NCLWW_FILTER);
|
||||
if (this->HandleEditBoxKey(WID_NCL_FILTER, key, keycode, state) == HEBR_EDITING) {
|
||||
this->OnOSKInput(WID_NCL_FILTER);
|
||||
}
|
||||
|
||||
return state;
|
||||
@ -740,8 +740,8 @@ public:
|
||||
|
||||
virtual void OnResize()
|
||||
{
|
||||
this->vscroll->SetCapacityFromWidget(this, NCLWW_MATRIX);
|
||||
this->GetWidget<NWidgetCore>(NCLWW_MATRIX)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
|
||||
this->vscroll->SetCapacityFromWidget(this, WID_NCL_MATRIX);
|
||||
this->GetWidget<NWidgetCore>(WID_NCL_MATRIX)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
|
||||
}
|
||||
|
||||
virtual void OnReceiveContentInfo(const ContentInfo *rci)
|
||||
@ -801,13 +801,13 @@ public:
|
||||
}
|
||||
|
||||
/* If data == 2 then the status window caused this OnInvalidate */
|
||||
this->SetWidgetDisabledState(NCLWW_DOWNLOAD, this->filesize_sum == 0 || (FindWindowById(WC_NETWORK_STATUS_WINDOW, 0) != NULL && data != 2));
|
||||
this->SetWidgetDisabledState(NCLWW_UNSELECT, this->filesize_sum == 0);
|
||||
this->SetWidgetDisabledState(NCLWW_SELECT_ALL, !show_select_all);
|
||||
this->SetWidgetDisabledState(NCLWW_SELECT_UPDATE, !show_select_upgrade);
|
||||
this->SetWidgetDisabledState(NCLWW_OPEN_URL, this->selected == NULL || StrEmpty(this->selected->url));
|
||||
this->SetWidgetDisabledState(WID_NCL_DOWNLOAD, this->filesize_sum == 0 || (FindWindowById(WC_NETWORK_STATUS_WINDOW, 0) != NULL && data != 2));
|
||||
this->SetWidgetDisabledState(WID_NCL_UNSELECT, this->filesize_sum == 0);
|
||||
this->SetWidgetDisabledState(WID_NCL_SELECT_ALL, !show_select_all);
|
||||
this->SetWidgetDisabledState(WID_NCL_SELECT_UPDATE, !show_select_upgrade);
|
||||
this->SetWidgetDisabledState(WID_NCL_OPEN_URL, this->selected == NULL || StrEmpty(this->selected->url));
|
||||
|
||||
this->GetWidget<NWidgetCore>(NCLWW_CANCEL)->widget_data = this->filesize_sum == 0 ? STR_AI_SETTINGS_CLOSE : STR_AI_LIST_CANCEL;
|
||||
this->GetWidget<NWidgetCore>(WID_NCL_CANCEL)->widget_data = this->filesize_sum == 0 ? STR_AI_SETTINGS_CLOSE : STR_AI_LIST_CANCEL;
|
||||
}
|
||||
};
|
||||
|
||||
@ -830,12 +830,12 @@ static const NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
||||
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_CONTENT_TITLE, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NCLWW_BACKGROUND),
|
||||
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NCL_BACKGROUND),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 7), SetResize(1, 0),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(8, 8, 8),
|
||||
/* Top */
|
||||
NWidget(WWT_EMPTY, COLOUR_LIGHT_BLUE, NCLWW_FILTER_CAPT), SetFill(1, 0), SetResize(1, 0),
|
||||
NWidget(WWT_EDITBOX, COLOUR_LIGHT_BLUE, NCLWW_FILTER), SetFill(1, 0), SetResize(1, 0),
|
||||
NWidget(WWT_EMPTY, COLOUR_LIGHT_BLUE, WID_NCL_FILTER_CAPT), SetFill(1, 0), SetResize(1, 0),
|
||||
NWidget(WWT_EDITBOX, COLOUR_LIGHT_BLUE, WID_NCL_FILTER), SetFill(1, 0), SetResize(1, 0),
|
||||
SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 7), SetResize(1, 0),
|
||||
@ -845,41 +845,41 @@ static const NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_CHECKBOX), SetMinimalSize(13, 1), SetDataTip(STR_EMPTY, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_TYPE),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_CHECKBOX), SetMinimalSize(13, 1), SetDataTip(STR_EMPTY, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_TYPE),
|
||||
SetDataTip(STR_CONTENT_TYPE_CAPTION, STR_CONTENT_TYPE_CAPTION_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_NAME), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_NAME), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_NAME_CAPTION, STR_CONTENT_NAME_CAPTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, NCLWW_MATRIX), SetResize(1, 14), SetFill(1, 1), SetScrollbar(NCLWW_SCROLLBAR), SetDataTip(STR_NULL, STR_CONTENT_MATRIX_TOOLTIP),
|
||||
NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, WID_NCL_MATRIX), SetResize(1, 14), SetFill(1, 1), SetScrollbar(WID_NCL_SCROLLBAR), SetDataTip(STR_NULL, STR_CONTENT_MATRIX_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, NCLWW_SCROLLBAR),
|
||||
NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, WID_NCL_SCROLLBAR),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
/* Right side. */
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NCLWW_DETAILS), SetResize(1, 1), SetFill(1, 1), EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NCL_DETAILS), SetResize(1, 1), SetFill(1, 1), EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 7), SetResize(1, 0),
|
||||
/* Bottom. */
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(8, 8, 8),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(8, 8, 8),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, NCLWW_SEL_ALL_UPDATE), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_SELECT_UPDATE), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NCL_SEL_ALL_UPDATE), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_SELECT_UPDATE), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_SELECT_UPDATES_CAPTION, STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_SELECT_ALL), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_SELECT_ALL), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_SELECT_ALL_CAPTION, STR_CONTENT_SELECT_ALL_CAPTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_UNSELECT), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_UNSELECT), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_UNSELECT_ALL_CAPTION, STR_CONTENT_UNSELECT_ALL_CAPTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(8, 8, 8),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_OPEN_URL), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_OPEN_URL), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_OPEN_URL, STR_CONTENT_OPEN_URL_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_CANCEL), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_CANCEL), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCLWW_DOWNLOAD), SetResize(1, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCL_DOWNLOAD), SetResize(1, 0), SetFill(1, 0),
|
||||
SetDataTip(STR_CONTENT_DOWNLOAD_CAPTION, STR_CONTENT_DOWNLOAD_CAPTION_TOOLTIP),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,40 +14,40 @@
|
||||
|
||||
/** Widgets of the WC_MUSIC_TRACK_SELECTION. */
|
||||
enum MusicTrackSelectionWidgets {
|
||||
MTSW_LIST_LEFT,
|
||||
MTSW_PLAYLIST,
|
||||
MTSW_LIST_RIGHT,
|
||||
MTSW_ALL,
|
||||
MTSW_OLD,
|
||||
MTSW_NEW,
|
||||
MTSW_EZY,
|
||||
MTSW_CUSTOM1,
|
||||
MTSW_CUSTOM2,
|
||||
MTSW_CLEAR,
|
||||
WID_MTS_LIST_LEFT, ///< Left button.
|
||||
WID_MTS_PLAYLIST, ///< Playlist.
|
||||
WID_MTS_LIST_RIGHT, ///< Right button.
|
||||
WID_MTS_ALL, ///< All button.
|
||||
WID_MTS_OLD, ///< Old button.
|
||||
WID_MTS_NEW, ///< New button.
|
||||
WID_MTS_EZY, ///< Ezy button.
|
||||
WID_MTS_CUSTOM1, ///< Custom1 button.
|
||||
WID_MTS_CUSTOM2, ///< Custom2 button.
|
||||
WID_MTS_CLEAR, ///< Clear button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_MUSIC_WINDOW. */
|
||||
enum MusicWidgets {
|
||||
MW_PREV,
|
||||
MW_NEXT,
|
||||
MW_STOP,
|
||||
MW_PLAY,
|
||||
MW_SLIDERS,
|
||||
MW_MUSIC_VOL,
|
||||
MW_EFFECT_VOL,
|
||||
MW_BACKGROUND,
|
||||
MW_TRACK,
|
||||
MW_TRACK_NR,
|
||||
MW_TRACK_TITLE,
|
||||
MW_TRACK_NAME,
|
||||
MW_SHUFFLE,
|
||||
MW_PROGRAMME,
|
||||
MW_ALL,
|
||||
MW_OLD,
|
||||
MW_NEW,
|
||||
MW_EZY,
|
||||
MW_CUSTOM1,
|
||||
MW_CUSTOM2,
|
||||
WID_M_PREV, ///< Previous button.
|
||||
WID_M_NEXT, ///< Next button.
|
||||
WID_M_STOP, ///< Stop button.
|
||||
WID_M_PLAY, ///< Play button.
|
||||
WID_M_SLIDERS, ///< Sliders.
|
||||
WID_M_MUSIC_VOL, ///< Music volume.
|
||||
WID_M_EFFECT_VOL, ///< Effect volume.
|
||||
WID_M_BACKGROUND, ///< Background of the window.
|
||||
WID_M_TRACK, ///< Track playing.
|
||||
WID_M_TRACK_NR, ///< Track number.
|
||||
WID_M_TRACK_TITLE, ///< Track title.
|
||||
WID_M_TRACK_NAME, ///< Track name.
|
||||
WID_M_SHUFFLE, ///< Shuffle button.
|
||||
WID_M_PROGRAMME, ///< Program button.
|
||||
WID_M_ALL, ///< All button.
|
||||
WID_M_OLD, ///< Old button.
|
||||
WID_M_NEW, ///< New button.
|
||||
WID_M_EZY, ///< Ezy button.
|
||||
WID_M_CUSTOM1, ///< Custom1 button.
|
||||
WID_M_CUSTOM2, ///< Custom2 button.
|
||||
};
|
||||
|
||||
#endif /* WIDGETS_MUSIC_WIDGET_H */
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
/** Widgets of the WC_SEND_NETWORK_MSG. */
|
||||
enum NetWorkChatWidgets {
|
||||
NWCW_CLOSE,
|
||||
NWCW_BACKGROUND,
|
||||
NWCW_DESTINATION,
|
||||
NWCW_TEXTBOX,
|
||||
NWCW_SENDBUTTON,
|
||||
WID_NC_CLOSE, ///< Close button.
|
||||
WID_NC_BACKGROUND, ///< Background of the window.
|
||||
WID_NC_DESTINATION, ///< Destination.
|
||||
WID_NC_TEXTBOX, ///< Textbox.
|
||||
WID_NC_SENDBUTTON, ///< Send button.
|
||||
};
|
||||
|
||||
|
||||
|
@ -13,35 +13,35 @@
|
||||
#define WIDGETS_NETWORK_CONTENT_WIDGET_H
|
||||
|
||||
/** Widgets of the WC_NETWORK_STATUS_WINDOW (WC_NETWORK_STATUS_WINDOW is also used in NetworkJoinStatusWidgets). */
|
||||
enum NetworkContentDownloadStatusWindowWidgets {
|
||||
NCDSWW_BACKGROUND, ///< Background
|
||||
NCDSWW_CANCELOK, ///< (Optional) Cancel/OK button
|
||||
enum NetworkContentDownloadStatusWidgets {
|
||||
WID_NCDS_BACKGROUND, ///< Background of the window.
|
||||
WID_NCDS_CANCELOK, ///< (Optional) Cancel/OK button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkGameWindowWidgets, NetworkStartServerWidgets, and NetworkLobbyWindowWidgets). */
|
||||
enum NetworkContentListWindowWidgets {
|
||||
NCLWW_BACKGROUND, ///< Resize button
|
||||
enum NetworkContentListWidgets {
|
||||
WID_NCL_BACKGROUND, ///< Resize button.
|
||||
|
||||
NCLWW_FILTER_CAPT, ///< Caption for the filter editbox
|
||||
NCLWW_FILTER, ///< Filter editbox
|
||||
WID_NCL_FILTER_CAPT, ///< Caption for the filter editbox.
|
||||
WID_NCL_FILTER, ///< Filter editbox.
|
||||
|
||||
NCLWW_CHECKBOX, ///< Button above checkboxes
|
||||
NCLWW_TYPE, ///< 'Type' button
|
||||
NCLWW_NAME, ///< 'Name' button
|
||||
WID_NCL_CHECKBOX, ///< Button above checkboxes.
|
||||
WID_NCL_TYPE, ///< 'Type' button.
|
||||
WID_NCL_NAME, ///< 'Name' button.
|
||||
|
||||
NCLWW_MATRIX, ///< Panel with list of content
|
||||
NCLWW_SCROLLBAR, ///< Scrollbar of matrix
|
||||
WID_NCL_MATRIX, ///< Panel with list of content.
|
||||
WID_NCL_SCROLLBAR, ///< Scrollbar of matrix.
|
||||
|
||||
NCLWW_DETAILS, ///< Panel with content details
|
||||
WID_NCL_DETAILS, ///< Panel with content details.
|
||||
|
||||
NCLWW_SELECT_ALL, ///< 'Select all' button
|
||||
NCLWW_SELECT_UPDATE, ///< 'Select updates' button
|
||||
NCLWW_UNSELECT, ///< 'Unselect all' button
|
||||
NCLWW_OPEN_URL, ///< 'Open url' button
|
||||
NCLWW_CANCEL, ///< 'Cancel' button
|
||||
NCLWW_DOWNLOAD, ///< 'Download' button
|
||||
WID_NCL_SELECT_ALL, ///< 'Select all' button.
|
||||
WID_NCL_SELECT_UPDATE, ///< 'Select updates' button.
|
||||
WID_NCL_UNSELECT, ///< 'Unselect all' button.
|
||||
WID_NCL_OPEN_URL, ///< 'Open url' button.
|
||||
WID_NCL_CANCEL, ///< 'Cancel' button.
|
||||
WID_NCL_DOWNLOAD, ///< 'Download' button.
|
||||
|
||||
NCLWW_SEL_ALL_UPDATE, ///< #NWID_SELECTION widget for select all/update buttons.
|
||||
WID_NCL_SEL_ALL_UPDATE, ///< #NWID_SELECTION widget for select all/update buttons..
|
||||
};
|
||||
|
||||
#endif /* WIDGETS_NETWORK_CONTENT_WIDGET_H */
|
||||
|
@ -12,117 +12,116 @@
|
||||
#ifndef WIDGETS_NETWORK_WIDGET_H
|
||||
#define WIDGETS_NETWORK_WIDGET_H
|
||||
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWindowWidgets, NetworkStartServerWidgets, and NetworkLobbyWindowWidgets). */
|
||||
enum NetworkGameWindowWidgets {
|
||||
NGWW_MAIN, ///< Main panel
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWidgets, NetworkStartServerWidgets, and NetworkLobbyWidgets). */
|
||||
enum NetworkGameWidgets {
|
||||
WID_NG_MAIN, ///< Main panel.
|
||||
|
||||
NGWW_CONNECTION, ///< Label in front of connection droplist
|
||||
NGWW_CONN_BTN, ///< 'Connection' droplist button
|
||||
NGWW_CLIENT_LABEL, ///< Label in front of client name edit box
|
||||
NGWW_CLIENT, ///< Panel with editbox to set client name
|
||||
WID_NG_CONNECTION, ///< Label in front of connection droplist.
|
||||
WID_NG_CONN_BTN, ///< 'Connection' droplist button.
|
||||
WID_NG_CLIENT_LABEL, ///< Label in front of client name edit box.
|
||||
WID_NG_CLIENT, ///< Panel with editbox to set client name.
|
||||
|
||||
NGWW_HEADER, ///< Header container of the matrix
|
||||
NGWW_NAME, ///< 'Name' button
|
||||
NGWW_CLIENTS, ///< 'Clients' button
|
||||
NGWW_MAPSIZE, ///< 'Map size' button
|
||||
NGWW_DATE, ///< 'Date' button
|
||||
NGWW_YEARS, ///< 'Years' button
|
||||
NGWW_INFO, ///< Third button in the game list panel
|
||||
WID_NG_HEADER, ///< Header container of the matrix.
|
||||
WID_NG_NAME, ///< 'Name' button.
|
||||
WID_NG_CLIENTS, ///< 'Clients' button.
|
||||
WID_NG_MAPSIZE, ///< 'Map size' button.
|
||||
WID_NG_DATE, ///< 'Date' button.
|
||||
WID_NG_YEARS, ///< 'Years' button.
|
||||
WID_NG_INFO, ///< Third button in the game list panel.
|
||||
|
||||
NGWW_MATRIX, ///< Panel with list of games
|
||||
NGWW_SCROLLBAR, ///< Scrollbar of matrix
|
||||
WID_NG_MATRIX, ///< Panel with list of games.
|
||||
WID_NG_SCROLLBAR, ///< Scrollbar of matrix.
|
||||
|
||||
NGWW_LASTJOINED_LABEL, ///< Label "Last joined server:"
|
||||
NGWW_LASTJOINED, ///< Info about the last joined server
|
||||
NGWW_LASTJOINED_SPACER, ///< Spacer after last joined server panel
|
||||
WID_NG_LASTJOINED_LABEL, ///< Label "Last joined server:".
|
||||
WID_NG_LASTJOINED, ///< Info about the last joined server.
|
||||
WID_NG_LASTJOINED_SPACER, ///< Spacer after last joined server panel.
|
||||
|
||||
NGWW_DETAILS, ///< Panel with game details
|
||||
NGWW_DETAILS_SPACER, ///< Spacer for game actual details
|
||||
NGWW_JOIN, ///< 'Join game' button
|
||||
NGWW_REFRESH, ///< 'Refresh server' button
|
||||
NGWW_NEWGRF, ///< 'NewGRF Settings' button
|
||||
NGWW_NEWGRF_SEL, ///< Selection 'widget' to hide the NewGRF settings
|
||||
NGWW_NEWGRF_MISSING, ///< 'Find missing NewGRF online' button
|
||||
NGWW_NEWGRF_MISSING_SEL, ///< Selection widget for the above button
|
||||
WID_NG_DETAILS, ///< Panel with game details.
|
||||
WID_NG_DETAILS_SPACER, ///< Spacer for game actual details.
|
||||
WID_NG_JOIN, ///< 'Join game' button.
|
||||
WID_NG_REFRESH, ///< 'Refresh server' button.
|
||||
WID_NG_NEWGRF, ///< 'NewGRF Settings' button.
|
||||
WID_NG_NEWGRF_SEL, ///< Selection 'widget' to hide the NewGRF settings.
|
||||
WID_NG_NEWGRF_MISSING, ///< 'Find missing NewGRF online' button.
|
||||
WID_NG_NEWGRF_MISSING_SEL, ///< Selection widget for the above button.
|
||||
|
||||
NGWW_FIND, ///< 'Find server' button
|
||||
NGWW_ADD, ///< 'Add server' button
|
||||
NGWW_START, ///< 'Start server' button
|
||||
NGWW_CANCEL, ///< 'Cancel' button
|
||||
WID_NG_FIND, ///< 'Find server' button.
|
||||
WID_NG_ADD, ///< 'Add server' button.
|
||||
WID_NG_START, ///< 'Start server' button.
|
||||
WID_NG_CANCEL, ///< 'Cancel' button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWindowWidgets, NetworkGameWindowWidgets, and NetworkLobbyWindowWidgets). */
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWidgets, NetworkGameWidgets, and NetworkLobbyWidgets). */
|
||||
enum NetworkStartServerWidgets {
|
||||
NSSW_BACKGROUND,
|
||||
NSSW_GAMENAME_LABEL,
|
||||
NSSW_GAMENAME, ///< Background for editbox to set game name
|
||||
NSSW_SETPWD, ///< 'Set password' button
|
||||
NSSW_CONNTYPE_LABEL,
|
||||
NSSW_CONNTYPE_BTN, ///< 'Connection type' droplist button
|
||||
NSSW_CLIENTS_LABEL,
|
||||
NSSW_CLIENTS_BTND, ///< 'Max clients' downarrow
|
||||
NSSW_CLIENTS_TXT, ///< 'Max clients' text
|
||||
NSSW_CLIENTS_BTNU, ///< 'Max clients' uparrow
|
||||
NSSW_COMPANIES_LABEL,
|
||||
NSSW_COMPANIES_BTND, ///< 'Max companies' downarrow
|
||||
NSSW_COMPANIES_TXT, ///< 'Max companies' text
|
||||
NSSW_COMPANIES_BTNU, ///< 'Max companies' uparrow
|
||||
NSSW_SPECTATORS_LABEL,
|
||||
NSSW_SPECTATORS_BTND, ///< 'Max spectators' downarrow
|
||||
NSSW_SPECTATORS_TXT, ///< 'Max spectators' text
|
||||
NSSW_SPECTATORS_BTNU, ///< 'Max spectators' uparrow
|
||||
WID_NSS_BACKGROUND, ///< Background of the window.
|
||||
WID_NSS_GAMENAME_LABEL, ///< Label for the game name.
|
||||
WID_NSS_GAMENAME, ///< Background for editbox to set game name.
|
||||
WID_NSS_SETPWD, ///< 'Set password' button.
|
||||
WID_NSS_CONNTYPE_LABEL, ///< Label for 'connection type'.
|
||||
WID_NSS_CONNTYPE_BTN, ///< 'Connection type' droplist button.
|
||||
WID_NSS_CLIENTS_LABEL, ///< Label for 'max clients'.
|
||||
WID_NSS_CLIENTS_BTND, ///< 'Max clients' downarrow.
|
||||
WID_NSS_CLIENTS_TXT, ///< 'Max clients' text.
|
||||
WID_NSS_CLIENTS_BTNU, ///< 'Max clients' uparrow.
|
||||
WID_NSS_COMPANIES_LABEL, ///< Label for 'max companies'.
|
||||
WID_NSS_COMPANIES_BTND, ///< 'Max companies' downarrow.
|
||||
WID_NSS_COMPANIES_TXT, ///< 'Max companies' text.
|
||||
WID_NSS_COMPANIES_BTNU, ///< 'Max companies' uparrow.
|
||||
WID_NSS_SPECTATORS_LABEL, ///< Label for 'max spectators'.
|
||||
WID_NSS_SPECTATORS_BTND, ///< 'Max spectators' downarrow.
|
||||
WID_NSS_SPECTATORS_TXT, ///< 'Max spectators' text.
|
||||
WID_NSS_SPECTATORS_BTNU, ///< 'Max spectators' uparrow.
|
||||
|
||||
NSSW_LANGUAGE_LABEL,
|
||||
NSSW_LANGUAGE_BTN, ///< 'Language spoken' droplist button
|
||||
WID_NSS_LANGUAGE_LABEL, ///< Label for 'language spoken'.
|
||||
WID_NSS_LANGUAGE_BTN, ///< 'Language spoken' droplist button.
|
||||
|
||||
NSSW_GENERATE_GAME, ///< New game button
|
||||
NSSW_LOAD_GAME, ///< Load game button
|
||||
NSSW_PLAY_SCENARIO, ///< Play scenario button
|
||||
NSSW_PLAY_HEIGHTMAP, ///< Play heightmap button
|
||||
WID_NSS_GENERATE_GAME, ///< New game button.
|
||||
WID_NSS_LOAD_GAME, ///< Load game button.
|
||||
WID_NSS_PLAY_SCENARIO, ///< Play scenario button.
|
||||
WID_NSS_PLAY_HEIGHTMAP, ///< Play heightmap button.
|
||||
|
||||
NSSW_CANCEL, ///< 'Cancel' button
|
||||
WID_NSS_CANCEL, ///< 'Cancel' button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWindowWidgets, NetworkGameWindowWidgets, and NetworkStartServerWidgets). */
|
||||
enum NetworkLobbyWindowWidgets {
|
||||
NLWW_BACKGROUND, ///< Background panel
|
||||
NLWW_TEXT, ///< Heading text
|
||||
NLWW_HEADER, ///< Header above list of companies
|
||||
NLWW_MATRIX, ///< List of companies
|
||||
NLWW_SCROLLBAR, ///< Scroll bar
|
||||
NLWW_DETAILS, ///< Company details
|
||||
NLWW_JOIN, ///< 'Join company' button
|
||||
NLWW_NEW, ///< 'New company' button
|
||||
NLWW_SPECTATE, ///< 'Spectate game' button
|
||||
NLWW_REFRESH, ///< 'Refresh server' button
|
||||
NLWW_CANCEL, ///< 'Cancel' button
|
||||
/** Widgets of the WC_NETWORK_WINDOW (WC_NETWORK_WINDOW is also used in NetworkContentListWidgets, NetworkGameWidgets, and NetworkStartServerWidgets). */
|
||||
enum NetworkLobbyWidgets {
|
||||
WID_NL_BACKGROUND, ///< Background of the window.
|
||||
WID_NL_TEXT, ///< Heading text.
|
||||
WID_NL_HEADER, ///< Header above list of companies.
|
||||
WID_NL_MATRIX, ///< List of companies.
|
||||
WID_NL_SCROLLBAR, ///< Scroll bar.
|
||||
WID_NL_DETAILS, ///< Company details.
|
||||
WID_NL_JOIN, ///< 'Join company' button.
|
||||
WID_NL_NEW, ///< 'New company' button.
|
||||
WID_NL_SPECTATE, ///< 'Spectate game' button.
|
||||
WID_NL_REFRESH, ///< 'Refresh server' button.
|
||||
WID_NL_CANCEL, ///< 'Cancel' button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_CLIENT_LIST. */
|
||||
enum ClientListWidgets {
|
||||
CLW_PANEL,
|
||||
WID_CL_PANEL, ///< Panel of the window.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_CLIENT_LIST_POPUP. */
|
||||
enum ClientListPopupWidgets {
|
||||
CLPW_PANEL,
|
||||
WID_CLP_PANEL, ///< Panel of the window.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_NETWORK_STATUS_WINDOW (WC_NETWORK_STATUS_WINDOW is also used in NetworkContentDownloadStatusWindowWidgets). */
|
||||
/** Widgets of the WC_NETWORK_STATUS_WINDOW (WC_NETWORK_STATUS_WINDOW is also used in NetworkContentDownloadStatusWidgets). */
|
||||
enum NetworkJoinStatusWidgets {
|
||||
NJSW_BACKGROUND, ///< Background
|
||||
NJSW_CANCELOK, ///< Cancel/OK button
|
||||
WID_NJS_BACKGROUND, ///< Background of the window.
|
||||
WID_NJS_CANCELOK, ///< Cancel / OK button.
|
||||
};
|
||||
|
||||
/** Widgets of the WC_COMPANY_PASSWORD_WINDOW. */
|
||||
enum NetworkCompanyPasswordWindowWidgets {
|
||||
NCPWW_BACKGROUND, ///< The background of the interface
|
||||
NCPWW_LABEL, ///< Label in front of the password field
|
||||
NCPWW_PASSWORD, ///< Input field for the password
|
||||
NCPWW_SAVE_AS_DEFAULT_PASSWORD, ///< Toggle 'button' for saving the current password as default password
|
||||
NCPWW_CANCEL, ///< Close the window without changing anything
|
||||
NCPWW_OK, ///< Safe the password etc.
|
||||
enum NetworkCompanyPasswordWidgets {
|
||||
WID_NCP_BACKGROUND, ///< Background of the window.
|
||||
WID_NCP_LABEL, ///< Label in front of the password field.
|
||||
WID_NCP_PASSWORD, ///< Input field for the password.
|
||||
WID_NCP_SAVE_AS_DEFAULT_PASSWORD, ///< Toggle 'button' for saving the current password as default password.
|
||||
WID_NCP_CANCEL, ///< Close the window without changing anything.
|
||||
WID_NCP_OK, ///< Safe the password etc.
|
||||
};
|
||||
|
||||
|
||||
#endif /* WIDGETS_NETWORK_WIDGET_H */
|
||||
|
Loading…
Reference in New Issue
Block a user