Win32 - GUI Dialog - added option to disable the context menu. Win32 Help CHM - added a page of lua functions & descriptions. Minor cleanup in lua-engine.cpp

This commit is contained in:
adelikat 2009-03-16 14:10:59 +00:00
parent efcc05ed8d
commit 3f60a5c6f8
8 changed files with 68 additions and 45 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released---
16-mar-2009 - adelikat - Win32 - GUI Dialog - added an option to disable the context menu
15-mar-2009 - adelikat - Lua - added movie.rerecordcount(), movie.length(), movie.getname(), movie.playbeginning(), FCEU.getreadonly(), FCEU.setreadonly()
14-mar-2009 - adelikat - Lua - added movie.active() - returns a bool value based on whether a movie is currently loaded
14-mar-2009 - adelikat - Fixed Joypad.set, it uses 3 values instead of 2 now. True will take control of a button and make it on, False will take control and make it off, and Nil will not take control (allowing the user to press the button)

View File

@ -54,6 +54,7 @@ extern bool bindSavestate;
extern int PPUViewRefresh;
extern int NTViewRefresh;
extern uint8 gNoBGFillColor;
extern bool rightClickEnabled;
//window positions and sizes:
extern int ChtPosX,ChtPosY;
@ -239,6 +240,7 @@ static CFGSTRUCT fceuconfig[] = {
AC(ClipSidesOffset),
AC(PPUViewRefresh),
AC(NTViewRefresh),
AC(rightClickEnabled),
//ACS(memwLastfile[2048]),
ENDCFGSTRUCT
};

View File

@ -2,6 +2,8 @@
#include "main.h"
#include "gui.h"
extern bool rightClickEnabled; //Declared in window.cpp and only an extern here
/**
* Processes information from the GUI options dialog after
* the dialog was closed.
@ -40,6 +42,16 @@ void CloseGuiDialog(HWND hwndDlg)
goptions |= GOO_DISABLESS;
}
if(IsDlgButtonChecked(hwndDlg, CB_ENABLECONTEXTMENU)==BST_CHECKED)
{
rightClickEnabled = true;
}
else
{
rightClickEnabled = false;
}
EndDialog(hwndDlg,0);
}
@ -72,6 +84,11 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
CheckDlgButton(hwndDlg, CB_DISABLE_SCREEN_SAVER, BST_CHECKED);
}
if(rightClickEnabled)
{
CheckDlgButton(hwndDlg, CB_ENABLECONTEXTMENU, BST_CHECKED);
}
CenterWindowOnScreen(hwndDlg);
break;

Binary file not shown.

View File

@ -551,12 +551,12 @@ BEGIN
PUSHBUTTON "Turbo A",318,195,122,32,12
END
GUICONFIG DIALOGEX 16, 123, 184, 90
GUICONFIG DIALOGEX 16, 123, 184, 108
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "GUI Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Close",BUTTON_CLOSE,64,68,56,14
DEFPUSHBUTTON "Close",BUTTON_CLOSE,64,86,56,14
CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,164,12
CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU,
@ -564,6 +564,8 @@ BEGIN
CONTROL "Ask confirmation on exit attempt.",CB_ASK_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,164,12
CONTROL "Disable screen saver while game is loaded.",CB_DISABLE_SCREEN_SAVER,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,53,164,12
CONTROL "Enable right-click context menu",CB_ENABLECONTEXTMENU,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,70,115,10
END
INPUTCONFIG DIALOGEX 122, 105, 349, 199
@ -1505,7 +1507,7 @@ BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 174
TOPMARGIN, 8
BOTTOMMARGIN, 82
BOTTOMMARGIN, 100
END
"INPUTCONFIG", DIALOG

View File

@ -406,6 +406,8 @@
#define BTN_CANCELED 1200
#define ID_SOUND_TRITOP 1201
#define ID_SOUND_QUALITYNOTIFY 1202
#define IDC_CHECK1 1203
#define CB_ENABLECONTEXTMENU 1203
#define MENU_NETWORK 40040
#define MENU_PALETTE 40041
#define MENU_SOUND 40042
@ -689,7 +691,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 125
#define _APS_NEXT_COMMAND_VALUE 40353
#define _APS_NEXT_CONTROL_VALUE 1203
#define _APS_NEXT_CONTROL_VALUE 1204
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -122,7 +122,10 @@ int MainWindow_wndx, MainWindow_wndy;
static uint32 mousex,mousey,mouseb;
static int vchanged = 0;
int menuYoffset = 0;
//Function Declarations
bool rightClickEnabled = true; //If set to false, the right click context menu will be disabled.
//Function Prototypes
void ChangeMenuItemText(int menuitem, string text); //Alters a menu item name
void ChangeContextMenuItemText(int menuitem, string text, HMENU menu); //Alters a context menu item name
@ -932,6 +935,8 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco;
case WM_RBUTTONUP:
{
if (rightClickEnabled)
{
hfceuxcontext = LoadMenu(fceu_hInstance,"FCEUCONTEXTMENUS");
@ -969,6 +974,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
ClientToScreen(hAppWnd, (LPPOINT) &pt); //Convert client area x,y to screen x,y
TrackPopupMenu(hfceuxcontextsub,0,(pt.x),(pt.y),TPM_RIGHTBUTTON,hWnd,0); //Create menu
}
}
case WM_MOVE:
{

View File

@ -872,13 +872,6 @@ static int savestate_load(lua_State *L) {
//
// Gets the frame counter for the movie, or nil if no movie running.
int movie_framecount(lua_State *L) {
/* // qfox, 08-11-21; fceu now counts the number of frames
//since the last reset if no movie is playing
if (!FCEUMOV_IsPlaying() && !FCEUMOV_IsRecording()) {
lua_pushnil(L);
return 1;
}
*/
lua_pushinteger(L, FCEUMOV_GetFrame());
return 1;