DECLARE SUB Menu11_Click()
DECLARE SUB Menu12_Click()
DECLARE SUB Menu13_Click()
DECLARE SUB Menu14_Click()
DECLARE SUB Menu21_Click()
DECLARE SUB Menu22_Click()
DECLARE SUB Menu23_Click()
DECLARE SUB Menu24_Click()
DECLARE SUB Menu25_Click()
DECLARE SUB Menu26_Click()
DECLARE SUB Menu15_Click()
DECLARE SUB Menu28_Click()
DECLARE SUB ShowBlocs()
DECLARE SUB AddBloc_OK_OnClick()
DECLARE SUB AddBloc_Cancel_OnClick()
DECLARE SUB Activemenu()
DECLARE SUB AddBlocFromFile_Browser_OnClick()
DECLARE SUB AddBlocFromFile_OK_OnClick()
DECLARE SUB AddBlocFromFile_Cancel_OnClick()
DIM r AS LONG
SUB Menu11_Click()
CreateBank
List.Clear
Stat.Clear
ActiveMenu
ShowBlocs
END SUB
SUB Menu12_Click()
fopen.CAPTION="Open a Bank"
fopen.Filter="Zecreator Bank Files|*.ZBK|All Files|*.*"
IF fopen.EXECUTE=false THEN
EXIT SUB
END IF
stat.clear
stat.addpanels "Loading..."
LoadBank fopen.Filename
ActiveMenu
ShowBlocs
END SUB
SUB Menu13_Click()
fsave.CAPTION="save a bank"
fsave.Filter="Zecreator Bank Files|*.ZBK|All files|*.*"
IF fsave.EXECUTE=false THEN
EXIT SUB
END IF
SaveBank fsave.Filename
END SUB
SUB Menu14_Click()
END
END SUB
SUB Menu15_Click()
fsave.CAPTION="Compress a bank"
fsave.Filter="Zecreator Bank Files|*.ZBK|All files|*.*"
IF fsave.EXECUTE=false THEN
EXIT SUB
END IF
CompressBank fsave.Filename
END SUB
SUB Menu21_Click()
AddBloc.CAPTION="Add bloc"
AddBloc_NameText.Text=""
AddBloc_NameText.enabled=True
AddBloc_ValueLabel.Visible=true
AddBloc_ValueText.Visible=true
AddBloc_ValueText.Text=""
AddBloc_Index.CAPTION="-1"
AddBloc.Repaint
AddBloc.SHOWMODAL
END SUB
SUB Menu22_Click()
AddBlocFromFile.CAPTION="Add Bloc from file"
AddBlocFromFile_NameText.Text=""
AddBlocFromFile_NameText.enabled=True
AddBlocFromFile_ValueText.Text=""
AddBlocFromFile_Index.CAPTION="-1"
AddBlocFromFile.Repaint
AddBlocFromFile.SHOWMODAL
END SUB
SUB Menu23_Click()
IF list.itemindex=-1 THEN
MESSAGEDLG "You must to select a bloc in the list.",mtwarning,0,0
EXIT SUB
END IF
AddBloc.CAPTION="Modify Bloc form"
AddBloc_NameText.Text=list.item(list.itemindex)
AddBloc_NameText.enabled=false
AddBloc_ValueText.Text=GetDataValue(list.item(list.itemindex))
AddBloc_Index.CAPTION=STR$(list.itemindex)
AddBloc.Repaint
AddBloc.SHOWMODAL
END SUB
SUB Menu24_Click()
IF list.itemindex=-1 THEN
MESSAGEDLG "You must to select a bloc in the list.",mtwarning,0,0
EXIT SUB
END IF
AddBlocFromFile.CAPTION="Modify Bloc from file"
AddBlocFromFile_NameText.Text=list.item(list.itemindex)
AddBlocFromFile_NameText.enabled=false
AddBlocFromFile_ValueText.Text=""
AddBlocFromFile_Index.CAPTION=STR$(list.itemindex)
AddBlocFromFile.Repaint
AddBlocFromFile.SHOWMODAL
END SUB
SUB Menu25_Click()
IF list.itemindex=-1 THEN
MESSAGEDLG "You must to select a bloc in the list.",mtwarning,0,0
EXIT SUB
END IF
AddBloc.CAPTION="Rename bloc"
AddBloc_NameText.Text=list.item(list.itemindex)
AddBloc_NameText.enabled=true
AddBloc_ValueLabel.Visible=false
AddBloc_ValueText.Visible=false
AddBloc_Index.CAPTION=STR$(list.item(list.itemindex))
AddBloc.Repaint
AddBloc.SHOWMODAL
END SUB
SUB Menu26_Click()
IF list.itemindex=-1 THEN
MESSAGEDLG "You must to select a bloc in the list.",mtwarning,0,0
EXIT SUB
END IF
IF MESSAGEDLG("Delete this bloc? Are you sure?", mtCustom, mbYes OR mbNo, 0) = mrNo THEN
EXIT SUB
END IF
DeleteData List.item(list.itemindex)
DOEVENTS
ShowBlocs
END SUB
SUB Menu28_Click()
IF list.itemindex=-1 THEN
MESSAGEDLG "You must to select a bloc in the list.",mtwarning,0,0
EXIT SUB
END IF
fsave.CAPTION="Extract bloc in a file"
fsave.Filter="All files|*.*"
IF fsave.EXECUTE=false THEN
EXIT SUB
END IF
ExtractDataToFile list.item(list.itemindex),fsave.Filename
END SUB
SUB ShowBlocs()
list.clear
FOR r=1 TO DatasCount
list.AddItems GetDataName(r)
NEXT
Stat.clear
Stat.AddPanels STR$(DatasCount) & " bloc(s) found"
END SUB
SUB AddBloc_OK_OnClick()
IF AddBloc_NameText.Text="" THEN
MESSAGEDLG "You must to enter a name of bloc.",mtWarning,0,0
EXIT SUB
END IF
IF AddBloc_ValueText.Text="" AND AddBloc_ValueText.visible=true THEN
MESSAGEDLG "You must to enter the datas of bloc.",mtWarning,0,0
EXIT SUB
END IF
IF AddBloc_Index.CAPTION="-1" AND AddBloc_ValueText.visible=true THEN
AddData AddBloc_NameText.Text,AddBloc_ValueText.Text
END IF
IF AddBloc_Index.CAPTION<>"-1" AND AddBloc_ValueText.visible=true THEN
ReplaceData AddBloc_NameText.Text,AddBloc_ValueText.Text
END IF
IF AddBloc_Index.CAPTION<>"-1" AND AddBloc_ValueText.visible=false THEN
RenameData List.item(List.Itemindex),AddBloc_NameText.Text
END IF
AddBloc.CLOSE
ShowBlocs
END SUB
SUB AddBloc_Cancel_OnClick()
AddBloc.CLOSE
END SUB
SUB ActiveMenu()
Menu2.Enabled=true
Menu13.Enabled=true
Menu15.Enabled=true
END SUB
SUB AddBlocFromFile_Browser_OnClick()
fopen.CAPTION="Select a file"
fopen.filter="All files|*.*"
IF fopen.EXECUTE=false THEN
EXIT SUB
END IF
AddBlocFromFile_ValueText.text=fopen.filename
END SUB
SUB AddBlocFromFile_Cancel_OnClick()
AddBlocFromFile.CLOSE
END SUB
SUB AddBlocFromFile_OK_OnClick()
IF AddBlocFromFile_NameText.Text="" THEN
MESSAGEDLG "You must to enter a name of bloc.",mtWarning,0,0
EXIT SUB
END IF
IF AddBlocFromFile_ValueText.Text="" THEN
MESSAGEDLG "You must to select a file to this bloc.",mtWarning,0,0
EXIT SUB
END IF
IF AddBlocFromFile_Index.CAPTION="-1" THEN
AddDataFromFile AddBlocFromFile_NameText.Text,AddBlocFromFile_ValueText.Text
END IF
IF AddBlocFromFile_Index.CAPTION<>"-1" THEN
ReplaceDataFromFile AddBlocFromFile_NameText.Text,AddBlocFromFile_ValueText.Text
END IF
AddBlocFromFile.CLOSE
ShowBlocs
END SUB
|