mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2024-11-05 05:26:55 +01:00
improved function naming
This commit is contained in:
parent
3d920f6168
commit
52cef11986
3 changed files with 8 additions and 10 deletions
|
@ -30,23 +30,23 @@ function main()
|
|||
local menuBar = createMenuBar(mainWindow)
|
||||
local menuFile = createMenu("&File", menuBar)
|
||||
local menuEntryNew = createMenuEntry("&New", menuFile)
|
||||
setKeySequence(menuEntryNew, "Ctrl+N")
|
||||
setMenuShortcut(menuEntryNew, "Ctrl+N")
|
||||
connect(menuEntryNew, "triggered()", "editorNew")
|
||||
local menuEntryOpen = createMenuEntry("&Open...", menuFile)
|
||||
setKeySequence(menuEntryOpen, "Ctrl+O")
|
||||
setMenuShortcut(menuEntryOpen, "Ctrl+O")
|
||||
connect(menuEntryOpen, "triggered()", "editorOpen")
|
||||
local menuEntrySave = createMenuEntry("&Save...", menuFile)
|
||||
setKeySequence(menuEntrySave, "Ctrl+S")
|
||||
setMenuShortcut(menuEntrySave, "Ctrl+S")
|
||||
connect(menuEntrySave, "triggered()", "editorSave")
|
||||
local menuEntrySaveAs = createMenuEntry("Save &as...", menuFile)
|
||||
connect(menuEntrySaveAs, "triggered()", "editorSaveAs")
|
||||
createMenuSeparator(menuFile)
|
||||
local menuEntryExit = createMenuEntry("&Exit", menuFile)
|
||||
setKeySequence(menuEntryExit, "Alt+F4")
|
||||
setMenuShortcut(menuEntryExit, "Alt+F4")
|
||||
connect(menuEntryExit, "triggered()", "editorClose")
|
||||
local menuHelp = createMenu("&Help", menuBar)
|
||||
local menuEntryAbout = createMenuEntry("&About LE Text Editor", menuHelp)
|
||||
setKeySequence(menuEntryAbout, "Ctrl+P")
|
||||
setMenuShortcut(menuEntryAbout, "Ctrl+P")
|
||||
connect(menuEntryAbout, "triggered()", "editorAboutBox")
|
||||
|
||||
textEditor = createPlainTextEdit("", mainWidget)
|
||||
|
|
|
@ -99,9 +99,6 @@ void LuaEngineGui::pushClass(lua_State *L_p)
|
|||
// Line Edit
|
||||
pushFunction(L_p, "createLineEdit", createLineEdit);
|
||||
|
||||
// Key Sequence
|
||||
pushFunction(L_p, "setKeySequence", setKeySequence);
|
||||
|
||||
// Main Window
|
||||
pushFunction(L_p, "createMainWindow", createMainWindow);
|
||||
pushFunction(L_p, "createCentralWidget", createCentralWidget);
|
||||
|
@ -111,6 +108,7 @@ void LuaEngineGui::pushClass(lua_State *L_p)
|
|||
pushFunction(L_p, "createMenuBar", createMenuBar);
|
||||
pushFunction(L_p, "createMenuEntry", createMenuEntry);
|
||||
pushFunction(L_p, "createMenuSeparator", createMenuSeparator);
|
||||
pushFunction(L_p, "setMenuShortcut", setMenuShortcut);
|
||||
|
||||
// Plain Text Edit
|
||||
pushFunction(L_p, "createPlainTextEdit", createPlainTextEdit);
|
||||
|
@ -326,7 +324,7 @@ int LuaEngineGui::setLayoutMargins(lua_State *L_p)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngineGui::setKeySequence(lua_State *L_p)
|
||||
int LuaEngineGui::setMenuShortcut(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 2) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
static int executeWidget(lua_State *L_p);
|
||||
static int showWidget(lua_State *L_p);
|
||||
static int setLayoutMargins(lua_State *L_p);
|
||||
static int setKeySequence(lua_State *L_p);
|
||||
static int setMenuShortcut(lua_State *L_p);
|
||||
static int setWidgetFixedSize(lua_State *L_p);
|
||||
static int setWidgetLayout(lua_State *L_p);
|
||||
static int setWidgetText(lua_State *L_p);
|
||||
|
|
Loading…
Reference in a new issue