Note)The labels will be translated in the coming days.
02) With Designer.init you can create functions, override functions, and much more;
you can even create your own compilation script for zig, mingw; a functional template will be available on GIT, you can create a simplified version from this template;
all the content of designer.init will be loaded into memory; some functions used in the example have been added to the core to be overridden with your own version;
Always refer to the template, questions can be asked in the designer group; it will be a new way to customize things to your personal liking;
03)Your project.init is a suitable place for you to create variables and functions relevant to the current project; no function here will be overwritten, because when you close the project and open a new one, the memory is freed and the init of the next project is loaded;
Imagine a scenario where you intend to migrate old code full of variables or functions that calculate the position and/or add default values; simply place them here and the designer will process and bring all the converted values to each object;
We are living in a world of speed, wasting time on manual positioning is burning money;
Although I've mentioned it before, you can customize the file headers to reflect your company's branding and include the correct licenses according to your project; simply edit the template. Note that you can use variables in the template, including those you can create in the functions mentioned earlier.
Keep in mind that this tool is for advanced users. While these features allow for greater freedom, a novice user could create systemic instability due to lack of care;
Here are some precautions that come to mind at the moment:
a) Adopt a personal standard for your functions or variable names so as not to conflict with internal ones (example: person_warning(), person_age(), Person_doc())
b) designer.init will overwrite functions if they already exist; this is a benefit but can be a major problem.
c) yourproject.init will not overwrite functions if they already exist.
This function is executed before creating the main form; it can be used to reset global variables or create your own. Use the prompt to navigate through the variables.
Function DesignerInit()
Public Person_var1, Person_var2, Person_var3
Return Nil
This function is called by the OnInit event of the main form; it receives the form object as a parameter. Each child object is located in form:controls:(child object), and you can manipulate any object.
Function DesignerOnInit(oMain)
oMain:controls:oExpression:action := {||Nil}
oMain:controls:oExpression:visible := .F.
oMain:controls:oExpression:Enabled := .F.
oMain:Maximize()
Return Nil
This function is called by the OnRelease event of the main form, and receives the form object as a parameter;
Function DesignerOnRelease(oMain)
Local aList:=directory(Pathprojeto+"\backup\*.*"),a,dLimite:=Date()-7
for each a in aList
if a[3] < dLimite
Ferase(Pathprojeto+"\backup\"+a[1])
endif
next
Return Nil
This function is called during the creation of the main form's menu, so you can inject new functionalities without limitation.
Function Designer_MenuPersonal(oMenu)
oMenu:AddPopup("Personal","cNameteste1",,"Fnt_MNU_DESIGNER")
*1.Prompt
*2.Bloco
*3.Nome
*4.Image
*5.Checked
*6.disabled
*7.Message
*8.FontName
oMenu:AddItem("Test Peronal 1",{||msginfo()},"Mnuteste1","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona2 1",{||msginfo()},"Mnuteste2","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona3 1",{||msginfo()},"Mnuteste3","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona4 1",{||msginfo()},"Mnuteste4","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona5 1",{||msginfo()},"Mnuteste5","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddPopup("Personal1","cdtatil",,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona6 1",{||msginfo()},"Mnuteste6","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona7 1",{||msginfo()},"Mnuteste7","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona8 1",{||msginfo()},"Mnuteste8","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona9 1",{||msginfo()},"Mnuteste9","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona10 1",{||msginfo()},"Mnuteste10","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:EndPopup()
oMenu:AddItem("Test Perona11 1",{||msginfo()},"Mnuteste11","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:AddItem("Test Perona12 1",{||msginfo()},"Mnuteste12","dbg_tracepoint",,,,"Fnt_MNU_DESIGNER")
oMenu:EndPopup()
Return oMenu
This function is called before saving the form to the .fmg file, it receives the code as a parameter and returns the code itself; you could inject some kind of customization here;
Function Designer_SaveFMG(cText)
Local nPos:=hb_ati("END WINDOW",cText)
if nPos>0
cText:=substr(cText,1,nPos-1)+" ....."+"END WINDOW"+
endif
Return cText
Replacing the user data function
Function TempUser()
Return "c:\temp\mytemp\"
If you are a Grigory donor and have access to Minigui professional, simply go to settings and adjust the path parameter (27/28/29)
Become a donor! Grigory needs your help to continue providing the excellent services he has offered for many years.
The Designer without Minigui is like an empty glass in the desert.