You know that classic feature that when we start a registration / edition or we are viewing a record and we need to code the state, color etc of the REGISTER, EDIT, CANCEL etc buttons or any other object sensitive to "datasource.state" ?


For it to work correctly, in forms that do not inherit from frmBaseCRUD/DETAIL or in secondary queries you need to add, in the desired datasource, in the StateChange event:


  if TDataSource( sender ).State in [ dsInsert, dsEdit, dsBrowse ] then

     rc_DSReactiveCheck( self , TDataSource( sender ) );


The attributes below will help reduce all this coding and give you several ways to improve your entries using your imagination.


They will "react" when the datasource linked to the attribute goes into "dsInsert / dsEdit / dsBrowse" mode.



- state-visible


state-visible:i-false e-true b-true 


Makes the object invisible when "dsInsert" ( i- )

Makes the object visible when "dsEdit" ( e- )

Makes the object visible when "dsBrowse" ( b- )


state-visible:empty-true ds:dsSearchMaster|


Makes the object visible when the dataset linked to the "dsSearchMaster" datasource is empty


Note: When "ds:" is not entered, RadCORE defaults to "dsMaster".



state-font-color:i-[[EDIT_COLOR_READONLY]] e-[[EDIT_FONT_COLOR]] b-[[EDIT_FONT_COLOR]] 


       Allows you to use the colors configured in the theme control in the editing components.

       

- state-enable


state-enable:i-false e-true b-true 


Disables the object when "dsInsert" ( i- )

Enable the object when "dsEdit" ( e- )

Enable the object when "dsBrowse" ( b- )


state-enable:empty-true ds:dsSearchMaster|


Enables the object when the dataset linked to the "dsSearchMaster" datasource is empty


- state-readonly


state-readonly:i-false e-true b-true


Disable object readonly when "dsInsert" ( i- )

Enables object readonly when "dsEdit" ( e- )

Enables object readonly when "dsBrowse" ( b- )


state-readonly:empty-true ds:dsSearchMaster|


Enables object readonly when dataset linked to datasource "dsSearchMaster" is empty


- state-color


state-color:i-clinfobk e-clskyblue b-clbtnface |


Change object color to "clinfobk" when "dsInsert" ( i- )

Change object color to "clskyblue" when "dsEdit" ( e- )

Change object color to "clbtnface" when "dsBrowse" ( b- )


Note: Useful to apply on "panels".


- state-font-color


state-font-color:i-clred e-clwhite b-clblack |


Changes object font color to "clred" when "dsInsert" ( i- )

Changes the object's font color to "clwhite" when "dsEdit" ( e- )

Changes object font color to "clblack" when "dsBrowse" ( b- )


Note: Useful to apply to "labels".


- state-caption


state-caption:i-Data Cadastro e-Data Edição b-Data |


Changes the object's caption to "Data Registration" when "dsInsert" ( i- )

Changes the object's caption to "Date Edit" when "dsEdit" ( e- )

Changes the object's caption to "Data" when "dsBrowse" ( b- )


Note: Useful to apply to "labels"


- state-cls


state-cls:i-rc-obj-float |


Applies a CSS class "rc-obj-float" when "dsInsert" ( i- )

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator