mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r7092) -Codechange: Add function to send a window message to a whole class of windows,
SendWindowMessageClass().
This commit is contained in:
parent
db98136bed
commit
45366b4372
16
window.c
16
window.c
|
@ -1325,6 +1325,22 @@ void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, uint msg, ui
|
|||
if (w != NULL) SendWindowMessageW(w, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
/** Send a message from one window to another. The message will be sent
|
||||
* to ALL windows of the windowclass specified in the first parameter
|
||||
* @param wnd_class @see WindowClass class
|
||||
* @param msg Specifies the message to be sent
|
||||
* @param wparam Specifies additional message-specific information
|
||||
* @param lparam Specifies additional message-specific information
|
||||
*/
|
||||
void SendWindowMessageClass(WindowClass wnd_class, uint msg, uint wparam, uint lparam)
|
||||
{
|
||||
Window *w;
|
||||
|
||||
for (w = _windows; w != _last_window; w++) {
|
||||
if (w->window_class == wnd_class) SendWindowMessageW(w, msg, wparam, lparam);
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleKeypress(uint32 key)
|
||||
{
|
||||
Window *w;
|
||||
|
|
1
window.h
1
window.h
|
@ -607,6 +607,7 @@ void CallWindowEventNP(Window *w, int event);
|
|||
void CallWindowTickEvent(void);
|
||||
void SetWindowDirty(const Window *w);
|
||||
void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, uint msg, uint wparam, uint lparam);
|
||||
void SendWindowMessageClass(WindowClass wnd_class, uint msg, uint wparam, uint lparam);
|
||||
|
||||
Window *FindWindowById(WindowClass cls, WindowNumber number);
|
||||
void DeleteWindow(Window *w);
|
||||
|
|
Loading…
Reference in New Issue