Skip to content

Commit

Permalink
M#3067: LuaFAR: far.SubscribeDialogDrawEvents не срабатывает в момент…
Browse files Browse the repository at this point in the history
… Msg==F.DN_INITDIALOG and Event==F.DE_DLGPROCINIT
  • Loading branch information
shmuz committed Sep 4, 2015
1 parent aaf4f19 commit 8daf591
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
Version = { 1, 0, 0, 524 },
Version = { 1, 0, 0, 525 },
MinFarVersion = { 3, 0, 0, 4363 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Expand Down
6 changes: 5 additions & 1 deletion plugins/luamacro/changelog
@@ -1,4 +1,8 @@
shmuel 31.08.2015 18:33:16 +0200 - build 524
shmuel 04.09.2015 21:48:41 +0200 - build 525

1. M#3067: LuaFAR: far.SubscribeDialogDrawEvents не срабатывает в момент Msg==F.DN_INITDIALOG and Event==F.DE_DLGPROCINIT

shmuel 31.08.2015 18:33:16 +0200 - build 524

1. M#3068: LuaFAR: не работает изменение цветовых атрибутов в DN_CTLCOLORDLGITEM

Expand Down
16 changes: 11 additions & 5 deletions plugins/luamacro/luafar/exported.c
Expand Up @@ -1299,21 +1299,27 @@ intptr_t LF_ProcessDialogEvent(lua_State* L, const struct ProcessDialogEventInfo
{
intptr_t ret = 0;
struct FarDialogEvent *fde = Info->Param;
const intptr_t Flags = GetPluginData(L)->Flags;
intptr_t *Flags = &GetPluginData(L)->Flags;
BOOL PushDN = FALSE;

if (Flags & PDF_PROCESSINGERROR)
if (*Flags & PDF_PROCESSINGERROR)
return 0;

if (!(Flags & PDF_DIALOGEVENTDRAWGROUP) && (
if (Info->Event == DE_DLGPROCINIT && fde->Msg == DN_INITDIALOG)
{
*Flags &= ~PDF_DIALOGEVENTDRAWENABLE;
}
else if (!(*Flags & PDF_DIALOGEVENTDRAWENABLE) && (
fde->Msg == DN_CTLCOLORDIALOG ||
fde->Msg == DN_CTLCOLORDLGITEM ||
fde->Msg == DN_CTLCOLORDLGLIST ||
fde->Msg == DN_DRAWDIALOG ||
fde->Msg == DN_DRAWDIALOGDONE ||
fde->Msg == DN_DRAWDLGITEM ||
fde->Msg == DN_DRAWDLGITEMDONE
)) return 0;
fde->Msg == DN_DRAWDLGITEMDONE))
{
return 0;
}

if (!GetExportFunction(L, "ProcessDialogEvent")) //+1: Func
return 0;
Expand Down
4 changes: 2 additions & 2 deletions plugins/luamacro/luafar/luafar.h
Expand Up @@ -20,8 +20,8 @@ extern "C" {

typedef intptr_t PLUGINDATAFLAGS;
static const PLUGINDATAFLAGS
PDF_DIALOGEVENTDRAWGROUP = 0x00000001,
PDF_PROCESSINGERROR = 0x00000002;
PDF_DIALOGEVENTDRAWENABLE = 0x00000001,
PDF_PROCESSINGERROR = 0x00000002;

typedef struct
{
Expand Down
8 changes: 2 additions & 6 deletions plugins/luamacro/luafar/service.c
Expand Up @@ -3400,11 +3400,6 @@ int PushDNParams (lua_State *L, intptr_t Msg, intptr_t Param1, void *Param2)
++Param1;
break;

case DN_INITDIALOG:
++Param1; // dialog element position
GetPluginData(L)->Flags &= ~PDF_DIALOGEVENTDRAWGROUP;
break;

case DN_BTNCLICK:
case DN_CTLCOLORDLGITEM:
case DN_CTLCOLORDLGLIST:
Expand All @@ -3416,6 +3411,7 @@ int PushDNParams (lua_State *L, intptr_t Msg, intptr_t Param1, void *Param2)
case DN_GOTFOCUS:
case DN_HELP:
case DN_HOTKEY:
case DN_INITDIALOG:
case DN_KILLFOCUS:
case DN_LISTCHANGE:
case DN_LISTHOTKEY:
Expand Down Expand Up @@ -3772,7 +3768,7 @@ static int far_SetDlgItem(lua_State *L)

static int far_SubscribeDialogDrawEvents(lua_State *L)
{
GetPluginData(L)->Flags |= PDF_DIALOGEVENTDRAWGROUP;
GetPluginData(L)->Flags |= PDF_DIALOGEVENTDRAWENABLE;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luamacro.rc
@@ -1,6 +1,6 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 524
#define PLUGIN_BUILD 525
#define PLUGIN_DESC "Lua Macros for Far Manager"
#define PLUGIN_NAME "LuaMacro"
#define PLUGIN_FILENAME "luamacro.dll"
Expand Down

0 comments on commit 8daf591

Please sign in to comment.