NewGRFWindow Struct Reference

Window for showing NewGRF files. More...

Inheritance diagram for NewGRFWindow:

Window ZeroedMemoryAllocator

Public Types

enum  ShowNewGRFStateWidgets {
  SNGRFS_CLOSEBOX = 0, SNGRFS_CAPTION, SNGRFS_BACKGROUND1, SNGRFS_PRESET_LIST,
  SNGRFS_PRESET_SAVE, SNGRFS_PRESET_DELETE, SNGRFS_BACKGROUND2, SNGRFS_ADD,
  SNGRFS_REMOVE, SNGRFS_MOVE_UP, SNGRFS_MOVE_DOWN, SNGRFS_FILE_LIST,
  SNGRFS_SCROLLBAR, SNGRFS_NEWGRF_INFO, SNGRFS_SET_PARAMETERS, SNGRFS_TOGGLE_PALETTE,
  SNGRFS_APPLY_CHANGES, SNGRFS_CONTENT_DOWNLOAD, SNGRFS_RESIZE
}

Public Member Functions

 NewGRFWindow (const WindowDesc *desc, bool editable, bool show_params, bool exec_changes, GRFConfig **config)
void SetupNewGRFWindow ()
virtual void OnPaint ()
 This window is currently being repainted.
virtual void OnClick (Point pt, int widget)
 A click with the left mouse button has been made on the window.
virtual void OnDropdownSelect (int widget, int index)
 A dropdown option associated to this window has been selected.
virtual void OnQueryTextFinished (char *str)
 The query window opened from this window has closed.
virtual void OnResize (Point new_size, Point delta)
 Called when the window got resized.
virtual void OnInvalidateData (int data)
 Some data on this window has become invalid.

Data Fields

GRFConfig ** orig_list
 grf list the window is shown with
GRFConfiglist
 temporary grf list to which changes are made
GRFConfigsel
 selected grf item
bool editable
 is the window editable
bool show_params
 are the grf-parameters shown in the info-panel
bool execute
 on pressing 'apply changes' are grf changes applied immediately, or only list is updated
int query_widget
 widget that opened a query
int preset
 selected preset

Detailed Description

Window for showing NewGRF files.

Definition at line 283 of file newgrf_gui.cpp.


Member Function Documentation

virtual void NewGRFWindow::OnClick ( Point  pt,
int  widget 
) [inline, virtual]

virtual void NewGRFWindow::OnDropdownSelect ( int  widget,
int  index 
) [inline, virtual]

A dropdown option associated to this window has been selected.

Parameters:
widget the widget (button) that the dropdown is associated with.
index the element in the dropdown that is selected.

Reimplemented from Window.

Definition at line 626 of file newgrf_gui.cpp.

References list, preset, sel, and Window::SetDirty().

virtual void NewGRFWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]

The query window opened from this window has closed.

Parameters:
str the new value of the string or NULL if the window was cancelled.

Reimplemented from Window.

Definition at line 647 of file newgrf_gui.cpp.

References SmallVector< T, S >::Length(), lengthof, list, GRFConfig::num_params, GRFConfig::param, parse_intlist(), preset, query_widget, sel, and Window::SetDirty().

virtual void NewGRFWindow::OnResize ( Point  new_size,
Point  delta 
) [inline, virtual]

Called when the window got resized.

Parameters:
new_size the new size of the window.
delta the amount of which the window size changed.

Reimplemented from Window.

Definition at line 682 of file newgrf_gui.cpp.

References Scrollbar::cap, Widget::data, ResizeButtons(), Window::vscroll, Window::widget, Point::x, and Point::y.

virtual void NewGRFWindow::OnInvalidateData ( int  data  )  [inline, virtual]

Some data on this window has become invalid.

Parameters:
data information about the changed data.

Reimplemented from Window.

Definition at line 695 of file newgrf_gui.cpp.

References GRFConfig::filename, GCS_NOT_FOUND, GCS_UNKNOWN, GRFIdentifier::grfid, GRFConfig::info, list, GRFIdentifier::md5sum, GRFConfig::name, GRFConfig::next, preset, and GRFConfig::status.


The documentation for this struct was generated from the following file:

Generated on Tue Jul 21 18:48:54 2009 for OpenTTD by  doxygen 1.5.6