21 #ifndef jwlua_fflua_customluawindow_h
22 #define jwlua_fflua_customluawindow_h
36 luabridge::LuaRef _handleCommand;
37 luabridge::LuaRef _handleUpDownPressed;
38 luabridge::LuaRef _handleDataListSelect;
39 luabridge::LuaRef _handleDataListCheck;
40 luabridge::LuaRef _handleCancelButtonPressed;
41 luabridge::LuaRef _handleOkButtonPressed;
42 luabridge::LuaRef _handleInitWindow;
44 bool _RegisterHandler(luabridge::LuaRef &class_storage, luabridge::LuaRef &lua_callback_function)
46 if (!lua_callback_function.isFunction())
return false;
47 class_storage = lua_callback_function;
51 void _OutputExceptionError(luabridge::LuaException e)
55 LuaRun_AppendLineToOutput(&errstring);
63 _handleCommand(_pGlobal_LuaState),
64 _handleUpDownPressed(_pGlobal_LuaState),
65 _handleDataListSelect(_pGlobal_LuaState),
66 _handleDataListCheck(_pGlobal_LuaState),
67 _handleCancelButtonPressed(_pGlobal_LuaState),
68 _handleOkButtonPressed(_pGlobal_LuaState),
69 _handleInitWindow(_pGlobal_LuaState)
83 return _RegisterHandler(_handleCommand, lua_callback_function);
97 return _RegisterHandler(_handleUpDownPressed, lua_callback_function);
111 return _RegisterHandler(_handleDataListSelect, lua_callback_function);
125 return _RegisterHandler(_handleDataListCheck, lua_callback_function);
139 return _RegisterHandler(_handleCancelButtonPressed, lua_callback_function);
153 return _RegisterHandler(_handleOkButtonPressed, lua_callback_function);
167 return _RegisterHandler(_handleInitWindow, lua_callback_function);
180 if (pControl && _handleCommand.isFunction())
184 _handleCommand(pControl);
186 catch (luabridge::LuaException e)
188 _OutputExceptionError(e);
206 if (pControl && _handleUpDownPressed.isFunction())
210 _handleUpDownPressed(pControl, delta);
212 catch (luabridge::LuaException e)
214 _OutputExceptionError(e);
230 if (pControl && _handleDataListSelect.isFunction())
234 _handleDataListSelect(pControl, lineindex);
236 catch (luabridge::LuaException e)
238 _OutputExceptionError(e);
255 if (pControl && _handleDataListCheck.isFunction())
259 _handleDataListCheck(pControl, lineindex, checkstate);
261 catch (luabridge::LuaException e)
263 _OutputExceptionError(e);
275 if (_handleCancelButtonPressed.isFunction())
279 _handleCancelButtonPressed();
281 catch (luabridge::LuaException e)
283 _OutputExceptionError(e);
296 if (_handleOkButtonPressed.isFunction())
300 _handleOkButtonPressed();
302 catch (luabridge::LuaException e)
304 _OutputExceptionError(e);
317 if (_handleInitWindow.isFunction())
323 catch (luabridge::LuaException e)
325 _OutputExceptionError(e);
bool RegisterInitWindow(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the InitWindow() event handler.
Definition: fflua_customluawindow.h:165
virtual void CancelButtonPressed()
Virtual handler method that is called when a control with a "Cancel" action is pressed by the user...
Definition: fflua_customluawindow.h:273
bool RegisterHandleDataListCheck(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the HandleDataListCheck() event handler.
Definition: fflua_customluawindow.h:123
bool RegisterHandleOkButtonPressed(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the OkButtonPressed() event handler.
Definition: fflua_customluawindow.h:151
void SetCString(const char *pszBuffer, int maxchars=-1)
Sets the string, using a C-string version of the string.
Definition: finaleframework.cpp:1030
virtual void HandleUpDownPressed(FCControl *pControl, int delta)
Virtual handler method for up/down arrow controls when they are clicked. Overwrite to provide functio...
Definition: ff_dialogs.h:1042
FCCustomLuaWindow()
The constructor.
Definition: fflua_customluawindow.h:62
virtual void InitWindow()
Inherited implementation of InitWindow().
Definition: finaleframework.cpp:26482
Class that handles a contol with multiple lines of data, arranged in columns.
Definition: ff_dialogs.h:2357
Definition: ff_dialogs.h:1237
virtual bool HandleCommand(FCControl *pControl)
Virtual method that is called when a user command occurs, such as a button press. ...
Definition: ff_dialogs.h:1024
virtual void HandleDataListCheck(FCCtrlDataList *pControl, int lineindex, bool checkstate)
Virtual handler method for when FCCtrlDataList check state changes (for data list controls with check...
Definition: fflua_customluawindow.h:252
virtual bool HandleCommand(FCControl *pControl)
Virtual method that is called when a user command occurs, such as a button press. ...
Definition: fflua_customluawindow.h:177
virtual void OkButtonPressed()
Virtual handler method that is called when a control with a "OK" action is pressed by the user...
Definition: ff_dialogs.h:998
virtual void HandleDataListCheck(FCCtrlDataList *pControl, int lineindex, bool checkstate)
Virtual handler method for when FCCtrlDataList check state changes (for data list controls with check...
Definition: ff_dialogs.h:1062
bool RegisterHandleCancelButtonPressed(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the CancelButtonPressed() event handler.
Definition: fflua_customluawindow.h:137
virtual void OkButtonPressed()
Virtual handler method that is called when a control with a "OK" action is pressed by the user...
Definition: fflua_customluawindow.h:294
virtual void HandleDataListSelect(FCCtrlDataList *pControl, int lineindex)
Virtual handler method for when FCCtrlDataList selection state changes.
Definition: fflua_customluawindow.h:227
bool RegisterHandleDataListSelect(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the HandleDataListSelect() event handler.
Definition: fflua_customluawindow.h:109
bool RegisterHandleCommand(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the HandleCommand() event handler.
Definition: fflua_customluawindow.h:81
Class that provides storage for text. This is to achieve platform-transparent text handling...
Definition: ff_base.h:1473
bool RegisterHandleUpDownPressed(luabridge::LuaRef lua_callback_function)
Registers a Lua function to the HandleUpDownPressed() event handler.
Definition: fflua_customluawindow.h:95
Special FCCustomWindow child class, that provides the additional functionality to hook up JW Lua call...
Definition: fflua_customluawindow.h:33
virtual void HandleDataListSelect(FCCtrlDataList *pControl, int lineindex)
Virtual handler method for when FCCtrlDataList selection state changes. Overwrite to provide function...
Definition: ff_dialogs.h:1051
virtual void CancelButtonPressed()
Virtual handler method that is called when a control with a "Cancel" action is pressed by the user...
Definition: ff_dialogs.h:1013
virtual void HandleUpDownPressed(FCControl *pControl, int delta)
Virtual handler method for up/down arrow controls when they are clicked.
Definition: fflua_customluawindow.h:203
virtual void InitWindow()
Virtual handler method that is called when a window just has been created, but not yet shown...
Definition: fflua_customluawindow.h:314
A class that supports programmatically created controls (that are not defined in resource files)...
Definition: ff_dialogs.h:3896