In the same way as you use conventional DELPHI components, you can create UNIGUI components and apply RadCORE resources.


You will have to remember that RadCORE uses some functions that render its resources (as mentioned in previous topics).


When creating components before standard RadCORE calls, they will render normally, but if you create them in other events in your code, you will need to render them.


Let's see some examples.


frmCadUSUARIOS


In the frameCreate event, components for dynamic permission control are created.


Note:

In the UNIGUI documentation it says that it is good practice to use "UniSession.SuspendLayouts();" before creating components and of course, "UniSession.ResumeLayouts();" at the end of the process.


Ex:

try

    UniSession.SuspendLayouts();

    .

    .

    .

finally

    UniSession.ResumeLayouts;

end;




Observing the creation code of the components you will see that soon after we will have the "inherited" because the "frmCadUSUARIOS" is inherited from "frmBaseCRUD" which inherits from "frmBase" which already contains the rendering instructions, so it is not necessary to call it them again.


frmDashboardSCHOOL



Observing the code we have the standard calls (according to the "Rendering the Layout" topic) where 2 of the main rendering functions specific to "UniFRAME" are used as you can see in "step 1 and 2".


In "step 3", in the "rc_UpdateCharts" function, components are created using some specific functions to facilitate the creation process (different from "frmCadUSUARIOS" ) and, at the end, the rendering and reorganization functions of responsive blocks.


frmDashboardECOMMERCE


A particularity of this example is the use of a "UniTimer" to update the chart examples, more specifically the "apexChart" example which, for some reason I'm not sure what it is, sometimes does not line up correctly with the responsive block. With this timer, everything works normally.



ISOLATED COMPONENTS


In some situations it may be necessary to render simple components, like a "UniLABEL" for example.


Take the "rc_Badge" function for example:



At the end, only the "rc_RenderControls" function is called, passing the object itself as parameters so that the function processes only 1 component.


FINAL CONSIDERATIONS


Study the examples and code for each of the rendering functions and you will see what they render, so it will be even easier to use these functions grouped or separately.

Created with the Personal Edition of HelpNDoc: iPhone web sites made easy