MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DlgLuaScriptDialog

Function DlgLuaScriptDialog

src/drivers/win/luaconsole.cpp:103–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103INT_PTR CALLBACK DlgLuaScriptDialog(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
104{
105// RECT r;
106// RECT r2;
107// int dx1, dy1, dx2, dy2;
108
109 switch (msg) {
110
111 case WM_INITDIALOG:
112 {
113 // remove the 30000 character limit from the console control
114 SendMessage(GetDlgItem(hDlg, IDC_LUACONSOLE),EM_LIMITTEXT,0,0);
115
116 extern POINT CalcSubWindowPos(HWND hDlg, POINT* conf);
117 CalcSubWindowPos(hDlg, NULL);
118
119
120 RECT r3;
121 GetClientRect(hDlg, &r3);
122 windowInfo.width = r3.right - r3.left;
123 windowInfo.height = r3.bottom - r3.top;
124 for(int i = 0; i < numControlLayoutInfos; i++) {
125 ControlLayoutState& layoutState = windowInfo.layoutState[i];
126 layoutState.valid = false;
127 }
128
129 DragAcceptFiles(hDlg, true);
130 SetDlgItemText(hDlg, IDC_EDIT_LUAPATH, FCEU_GetLuaScriptName());
131
132 SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &LuaConsoleLogFont, 0); // reset with an acceptable font
133 return true;
134 } break;
135
136 case WM_SIZE:
137 {
138 // resize or move controls in the window as necessary when the window is resized
139
140 //LuaPerWindowInfo& windowInfo = LuaWindowInfo[hDlg];
141 int prevDlgWidth = windowInfo.width;
142 int prevDlgHeight = windowInfo.height;
143
144 int dlgWidth = LOWORD(lParam);
145 int dlgHeight = HIWORD(lParam);
146
147 int deltaWidth = dlgWidth - prevDlgWidth;
148 int deltaHeight = dlgHeight - prevDlgHeight;
149
150 for(int i = 0; i < numControlLayoutInfos; i++)
151 {
152 ControlLayoutInfo layoutInfo = controlLayoutInfos[i];
153 ControlLayoutState& layoutState = windowInfo.layoutState[i];
154
155 HWND hCtrl = GetDlgItem(hDlg,layoutInfo.controlID);
156
157 int x,y,width,height;
158 if(layoutState.valid)
159 {
160 x = layoutState.x;

Callers

nothing calls this directly

Calls 6

CalcSubWindowPosFunction · 0.85
FCEU_GetLuaScriptNameFunction · 0.85
GetDlgItemTextFunction · 0.85
FCEU_LoadLuaCodeFunction · 0.85
FCEU_LuaStopFunction · 0.85
FCEU_GetPathFunction · 0.85

Tested by

no test coverage detected