; =========================================================
; This file was generated by NSISDialogDesigner 1.6.0.0
; https://coolsoft.altervista.org/nsisdialogdesigner
;
; Do not edit it manually, use NSISDialogDesigner instead!
; =========================================================

; handle variables
Var hCtl_log_dlg
Var hCtl_log_dlg_file_group
Var hCtl_log_dlg_max_files_help
Var hCtl_log_dlg_max_files_help_hImage
Var hCtl_log_dlg_max_file_size_help
Var hCtl_log_dlg_max_file_size_help_hImage
Var hCtl_log_dlg_label_max_files
Var hCtl_log_dlg_log_file_Txt
Var hCtl_log_dlg_log_file_Btn
Var hCtl_log_dlg_label_max_file_size
Var hCtl_log_dlg_max_file_size
Var hCtl_log_dlg_label_log_file
Var hCtl_log_dlg_max_files
Var hCtl_log_dlg_log_type
Var hCtl_log_dlg_log_level
Var hCtl_log_dlg_Label12
Var hCtl_log_dlg_Label13


; dialog create function
Function fnc_log_dlg_Create
  
  ; === log_dlg (type: Dialog) ===
  nsDialogs::Create 1018
  Pop $hCtl_log_dlg
  ${If} $hCtl_log_dlg == error
    Abort
  ${EndIf}
  !insertmacro MUI_HEADER_TEXT "logs" "logs"
  
  ; === file_group (type: GroupBox) ===
  ${NSD_CreateGroupBox} 8u 35u 255u 63u "Log File"
  Pop $hCtl_log_dlg_file_group
  
  ; === max_files_help (type: Bitmap) ===
  ${NSD_CreateBitmap} 186u 76u 12u 11u ""
  Pop $hCtl_log_dlg_max_files_help
  ${NSD_OnClick} $hCtl_log_dlg_max_files_help max_files_help_onClick
  File "/oname=$PLUGINSDIR\info.bmp" "resources\info.bmp"
  ${NSD_SetImage} $hCtl_log_dlg_max_files_help "$PLUGINSDIR\info.bmp" $hCtl_log_dlg_max_files_help_hImage
  
  ; === max_file_size_help (type: Bitmap) ===
  ${NSD_CreateBitmap} 186u 61u 12u 11u ""
  Pop $hCtl_log_dlg_max_file_size_help
  ${NSD_OnClick} $hCtl_log_dlg_max_file_size_help max_file_size_help_onClick
  File "/oname=$PLUGINSDIR\info.bmp" "resources\info.bmp"
  ${NSD_SetImage} $hCtl_log_dlg_max_file_size_help "$PLUGINSDIR\info.bmp" $hCtl_log_dlg_max_file_size_help_hImage
  
  ; === label_max_files (type: Label) ===
  ${NSD_CreateLabel} 13u 78u 73u 10u "Max number of files:"
  Pop $hCtl_log_dlg_label_max_files
  
  ; === log_file_Txt (type: Text) ===
  ${NSD_CreateText} 88u 44u 150u 12u ""
  Pop $hCtl_log_dlg_log_file_Txt
  
  ; === log_file_Btn (type: Button) ===
  ${NSD_CreateButton} 240u 44u 20u 12u "..."
  Pop $hCtl_log_dlg_log_file_Btn
  ${NSD_OnClick} $hCtl_log_dlg_log_file_Btn fnc_hCtl_log_dlg_log_file_Click
  
  ; === label_max_file_size (type: Label) ===
  ${NSD_CreateLabel} 13u 61u 73u 11u "Max File Size (Mo):"
  Pop $hCtl_log_dlg_label_max_file_size
  
  ; === max_file_size (type: Number) ===
  ${NSD_CreateNumber} 88u 60u 93u 12u ""
  Pop $hCtl_log_dlg_max_file_size
  
  ; === label_log_file (type: Label) ===
  ${NSD_CreateLabel} 13u 46u 66u 10u "Log file:"
  Pop $hCtl_log_dlg_label_log_file
  
  ; === max_files (type: Number) ===
  ${NSD_CreateNumber} 88u 76u 93u 12u ""
  Pop $hCtl_log_dlg_max_files
  
  ; === log_type (type: DropList) ===
  ${NSD_CreateDropList} 111u 2u 80u 13u ""
  Pop $hCtl_log_dlg_log_type
  ${NSD_OnChange} $hCtl_log_dlg_log_type on_log_type_changed
  ${NSD_CB_AddString} $hCtl_log_dlg_log_type "Event-log"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_type "File"
  
  ; === log_level (type: DropList) ===
  ${NSD_CreateDropList} 111u 18u 80u 13u ""
  Pop $hCtl_log_dlg_log_level
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Off"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Critical"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Error"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Warning"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Info"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Debug"
  ${NSD_CB_AddString} $hCtl_log_dlg_log_level "Trace"
  
  ; === Label12 (type: Label) ===
  ${NSD_CreateLabel} 8u 20u 57u 11u "Log level:"
  Pop $hCtl_log_dlg_Label12
  
  ; === Label13 (type: Label) ===
  ${NSD_CreateLabel} 8u 4u 57u 11u "Log type:"
  Pop $hCtl_log_dlg_Label13
  
  ; CreateFunctionCustomScript
  Call init_log_dlg
  Call on_log_type_changed
  
  
FunctionEnd

; dialog show function
Function fnc_log_dlg_Show
  Call fnc_log_dlg_Create
  nsDialogs::Show
FunctionEnd


; onClick handler for FileRequest Button $hCtl_log_dlg_log_file_Btn
Function fnc_hCtl_log_dlg_log_file_Click
	Pop $R0
	${If} $R0 == $hCtl_log_dlg_log_file_Btn
		${NSD_GetText} $hCtl_log_dlg_log_file_Txt $R0
		nsDialogs::SelectFileDialog save "$R0" ".log files|*.log"
		Pop $R0
		${If} "$R0" != ""
			${NSD_SetText} $hCtl_log_dlg_log_file_Txt "$R0"
		${EndIf}
	${EndIf}
FunctionEnd
