Skip to content

Commit

Permalink
Uninstall sources v1.10.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Dec 26, 2020
1 parent 57ebeee commit c46033e
Show file tree
Hide file tree
Showing 15 changed files with 746 additions and 142 deletions.
106 changes: 80 additions & 26 deletions Uninstall/src/DlgBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class DialogBuilderBase
}
}

T *AddDialogItem(int Type, const TCHAR *Text)
T* AddDialogItem(int Type, const TCHAR *Text)
{
if (DialogItemsCount == DialogItemsAllocated)
{
Expand Down Expand Up @@ -365,7 +365,7 @@ class DialogBuilderBase
return -1;
}

DialogItemBinding<T> *FindBinding(const T *Item)
DialogItemBinding<T>* FindBinding(const T *Item)
{
int Index = static_cast<int>(Item - DialogItems);
if (Index >= 0 && Index < DialogItemsCount)
Expand All @@ -388,7 +388,7 @@ class DialogBuilderBase
}
}

virtual const TCHAR *GetLangString(int MessageID)
virtual const TCHAR* GetLangString(int MessageID)
{
return nullptr;
}
Expand All @@ -398,12 +398,17 @@ class DialogBuilderBase
return -1;
}

virtual DialogItemBinding<T> *CreateCheckBoxBinding(BOOL *Value, int Mask)
virtual DialogItemBinding<T>* CreateCheckBoxBinding(BOOL *Value, int Mask)
{
return nullptr;
}

virtual DialogItemBinding<T> *CreateRadioButtonBinding(int *Value)
virtual DialogItemBinding<T>* CreateComboBoxBinding(int *Value)
{
return nullptr;
}

virtual DialogItemBinding<T>* CreateRadioButtonBinding(int *Value)
{
return nullptr;
}
Expand All @@ -423,17 +428,17 @@ class DialogBuilderBase
}
delete [] DialogItems;
delete [] Bindings;
}
};

public:
// Äîáàâëÿåò ñòàòè÷åñêèé òåêñò, ðàñïîëîæåííûé íà îòäåëüíîé ñòðîêå â äèàëîãå.
T *AddText(int LabelId)
T* AddText(int LabelId)
{
T *Item = AddDialogItem(DI_TEXT, GetLangString(LabelId));
SetNextY(Item);
return Item;
}
T *AddText(const TCHAR* asText)
T* AddText(const TCHAR* asText)
{
T *Item = AddDialogItem(DI_TEXT, asText);
SetNextY(Item);
Expand All @@ -446,7 +451,7 @@ class DialogBuilderBase
//}

// Äîáàâëÿåò ÷åêáîêñ.
T *AddCheckbox(int TextMessageId, BOOL *Value, int Mask=0)
T* AddCheckbox(int TextMessageId, BOOL *Value, int Mask=0)
{
T *Item = AddDialogItem(DI_CHECKBOX, GetLangString(TextMessageId));
SetNextY(Item);
Expand Down Expand Up @@ -489,14 +494,33 @@ class DialogBuilderBase
return nFirstID;
}

// Äîáàâëÿåò ComboBox
T* AddComboBox(int Width, FarList* ListItems, int *Value, DWORD AddFlags=DIF_DROPDOWNLIST)
{
T *Item = AddDialogItem(DI_COMBOBOX, nullptr);
for (int i = 0; i < ListItems->ItemsNumber; i++)
{
if (i == *Value)
ListItems->Items[i].Flags |= LIF_SELECTED;
else if (ListItems->Items[i].Flags & LIF_SELECTED)
ListItems->Items[i].Flags &= ~LIF_SELECTED;
}
Item->ListItems = ListItems;
Item->Flags |= AddFlags;
SetNextY(Item);
Item->X2 = Item->X1 + Width;
SetLastItemBinding(CreateComboBoxBinding(Value));
return Item;
}

// Äîáàâëÿåò ïîëå òèïà DI_FIXEDIT äëÿ ðåäàêòèðîâàíèÿ óêàçàííîãî ÷èñëîâîãî çíà÷åíèÿ.
virtual T *AddIntEditField(int *Value, int Width)
virtual T* AddIntEditField(int *Value, int Width)
{
return nullptr;
}

// Äîáàâëÿåò óêàçàííóþ òåêñòîâóþ ñòðîêó ñëåâà îò ýëåìåíòà RelativeTo.
T *AddTextBefore(T *RelativeTo, int LabelId)
T* AddTextBefore(T *RelativeTo, int LabelId)
{
T *Item = AddDialogItem(DI_TEXT, GetLangString(LabelId));
Item->Y1 = Item->Y2 = RelativeTo->Y1;
Expand Down Expand Up @@ -545,7 +569,7 @@ class DialogBuilderBase
}

// Äîáàâëÿåò óêàçàííóþ òåêñòîâóþ ñòðîêó ñïðàâà îò ýëåìåíòà RelativeTo.
T *AddTextAfter(T *RelativeTo, int LabelId)
T* AddTextAfter(T *RelativeTo, int LabelId)
{
T *Item = AddDialogItem(DI_TEXT, GetLangString(LabelId));
Item->Y1 = Item->Y2 = RelativeTo->Y1;
Expand Down Expand Up @@ -735,6 +759,24 @@ class PluginRadioButtonBinding: public DialogAPIBinding
}
};

class PluginComboBoxBinding: public DialogAPIBinding
{
private:
int *Value;

public:
PluginComboBoxBinding(const PluginStartupInfo &aInfo, HANDLE *aHandle, int aID, int *aValue)
: DialogAPIBinding(aInfo, aHandle, aID),
Value(aValue)
{
}

virtual void SaveValue(FarDialogItem *Item, int RadioGroupIndex)
{
*Value = (int)Info.SendDlgMessage(*DialogHandle, DM_LISTGETCURPOS, ID, 0);
}
};

#ifdef UNICODE

class PluginEditFieldBinding: public DialogAPIBinding
Expand Down Expand Up @@ -781,12 +823,12 @@ class PluginIntEditFieldBinding: public DialogAPIBinding
*Value = Info.FSF->atoi(DataPtr);
}

TCHAR *GetBuffer()
TCHAR* GetBuffer()
{
return Buffer;
}

const TCHAR *GetMask()
const TCHAR* GetMask()
{
return Mask;
}
Expand Down Expand Up @@ -834,7 +876,7 @@ class PluginIntEditFieldBinding: public DialogItemBinding<FarDialogItem>
*Value = Info.FSF->atoi(Item->Data);
}

const TCHAR *GetMask()
const TCHAR* GetMask()
{
return Mask;
}
Expand All @@ -857,11 +899,14 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
virtual void InitDialogItem(FarDialogItem *Item, const TCHAR *Text)
{
memset(Item, 0, sizeof(FarDialogItem));
#ifdef UNICODE
Item->PtrData = Text;
#else
lstrcpyn(Item->Data, Text, sizeof(Item->Data)/sizeof(Item->Data[0]));
#endif
if (Text)
{
#ifdef UNICODE
Item->PtrData = Text;
#else
lstrcpyn(Item->Data, Text, sizeof(Item->Data)/sizeof(Item->Data[0]));
#endif
}
}

virtual int TextWidth(const FarDialogItem &Item)
Expand All @@ -873,7 +918,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
#endif
}

virtual const TCHAR *GetLangString(int MessageID)
virtual const TCHAR* GetLangString(int MessageID)
{
return Info.GetMsg(Info.ModuleNumber, MessageID);
}
Expand All @@ -892,7 +937,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
#endif
}

virtual DialogItemBinding<FarDialogItem> *CreateCheckBoxBinding(BOOL *Value, int Mask)
virtual DialogItemBinding<FarDialogItem>* CreateCheckBoxBinding(BOOL *Value, int Mask)
{
#ifdef UNICODE
return new PluginCheckBoxBinding(Info, &DialogHandle, DialogItemsCount-1, Value, Mask);
Expand All @@ -901,7 +946,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
#endif
}

virtual DialogItemBinding<FarDialogItem> *CreateRadioButtonBinding(BOOL *Value)
virtual DialogItemBinding<FarDialogItem>* CreateRadioButtonBinding(BOOL *Value)
{
#ifdef UNICODE
return new PluginRadioButtonBinding(Info, &DialogHandle, DialogItemsCount-1, Value);
Expand All @@ -910,6 +955,15 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
#endif
}

virtual DialogItemBinding<FarDialogItem>* CreateComboBoxBinding(int *Value)
{
#ifdef UNICODE
return new PluginComboBoxBinding(Info, &DialogHandle, DialogItemsCount-1, Value);
#else
return new PluginComboBoxBinding<FarDialogItem>(Value);
#endif
}

public:
PluginDialogBuilder(const PluginStartupInfo &aInfo, int TitleMessageID, const TCHAR *aHelpTopic)
: DialogFlags(0), Info(aInfo), DialogHandle(NULL), HelpTopic(aHelpTopic)
Expand All @@ -928,7 +982,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
#endif
}

FarDialogItem *GetItemByIndex(int Index)
FarDialogItem* GetItemByIndex(int Index)
{
if (Index >= 0 && Index < DialogItemsCount)
return (DialogItems + Index);
Expand All @@ -940,7 +994,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
return GetItemID(p);
}

virtual FarDialogItem *AddIntEditField(int *Value, int Width)
virtual FarDialogItem* AddIntEditField(int *Value, int Width)
{
FarDialogItem *Item = AddDialogItem(DI_FIXEDIT, EMPTY_TEXT);
Item->Flags |= DIF_MASKEDIT;
Expand All @@ -965,7 +1019,7 @@ class PluginDialogBuilder: public DialogBuilderBase<FarDialogItem>
return Item;
}

FarDialogItem *AddEditField(TCHAR *Value, int MaxSize, int Width, const TCHAR *HistoryID = nullptr)
FarDialogItem* AddEditField(TCHAR *Value, int MaxSize, int Width, const TCHAR *HistoryID = nullptr)
{
FarDialogItem *Item = AddDialogItem(DI_EDIT, Value);
SetNextY(Item);
Expand Down
84 changes: 47 additions & 37 deletions Uninstall/src/FarLang.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
enum {
MPlugIn,
MOK,

MUninstallEntry,
MUninstallEntryMSI,

MName,
MSubKeyName,
MInstallLocation,
MModifyCommand,
MUninstallCommand,
MPublisher,
MSupportInfo,
MProductUpdates,
MComments,
MVersion,
MInstallDate,
#pragma once

MListHKLMx86,
MListHKLMx64,
MListHKLM,
MListHKCU,

MRunProgErr,
MCancelledByUser,
MDelRegErr,
MConfirm,
MBottomLine,
MFilter,
MWaitingCompletion,

MShowInEditor,
MShowInViewer,
MEnterWaitCompletion,
MUseElevation,
MBtnOk,
MBtnCancel,
};
enum {
MPlugIn=0,
MBtnOk,
MBtnCancel,
MWaitingCompletion,
MShowInEditor,
MShowInViewer,
MEnterWaitCompletion,
MUseElevation,
MLowPriority,
MEnterAction,
MShiftEnterAction,
MActionUninstallWait,
MActionUninstall,
MActionModifyWait,
MActionModify,
MActionRepairWait,
MActionRepair,
MActionMenu,
MUninstallEntry,
MUninstallEntryMSI,
MName,
MSubKeyName,
MInstallLocation,
MModifyCommand,
MUninstallCommand,
MPublisher,
MSupportInfo,
MProductUpdates,
MComments,
MVersion,
MInstallDate,
MBottomLine,
MFilter,
MMenuBottomLine1,
MMenuBottomLine2,
MMenuTopLine,
MListHKLMx86,
MListHKLMx64,
MListHKLM,
MListHKCU,
MRunProgErr,
MCancelledByUser,
MDelRegErr,
MConfirm,
};
3 changes: 2 additions & 1 deletion Uninstall/src/File_ID.diz
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ E-Mail: [email protected]
Новые версии: http://forum.farmanager.com/viewtopic.php?t=3529
Обсуждение: http://forum.farmanager.com/viewtopic.php?t=3597

Версия 1.10.8: [email protected]
Поддержка начиная с версии 1.10.8:
[email protected]
Loading

0 comments on commit c46033e

Please sign in to comment.