CET Developer Guides
Tutorial: Adopting the new UI ...
Tutorial: Integrating Message Banners
7min
before you start it is highly recommended for you to review the following articles if you have not already done so, to ensure that you understand the types of message banners to create, and how to write banner messages like a pro system status docid\ f2u u kmhqhnlidgry57f content design docid\ k3ngmmg8pdpwwy22it qi message banner docid\ a1 btlqjmnnupovc3 hbj predefined message types as mentioned in system status docid\ f2u u kmhqhnlidgry57f , there are a total of 4 standardized message types to ensure a smooth creation process, we have predefined them as messagetypes which you can find their corresponding code mappings as follow message type corresponding message type in code information messagetype info warning messagetype warning error messagetype error success messagetype success default messagetype undefined these standardized message types (excluding messagetype undefined ) when utilized, will automatically apply all relevant banner styles onto your message banners upon creation thus, no further customization work is required creating message banners message banners can be placed in toolboxes to convey various types of information to users that is relevant to the toolbox itself the positioning of these banners are not fixed , so you may place them in relevant toolbox sections as you see fit however, they will always adhere to the toolbox's width by default message banners are created using messagelimbs which will be demonstrated below standardized to create a standardized message banner, firstly ensure that you have a librarylimb created, then append a messagelimb within it ensure that the messagetype parameter is specified with a message type, as listed above additionally, the label parameter can be utilized to specify the banner's message cm librarylimb examplelimb( ); messagelimb(examplelimb, pkg, key="examplekey", // to specify banner message label="text about what has occurred ", // to specify message type messagetype=messagetype info); cm container librarylimb examplelimb( ) { // append message limbs like usual limbs limb messagelimb examplemessage( key="examplekey", // to specify banner message label="text about what has occurred ", // to specify message type messagetype=messagetype info ) } custom in addition to standardized message banners, you can also create message banners with custom styles this can be done by utilizing an alternative messagelimb constructor without specifying the messagetype parameter by creating a custom message banner, additional work is required to specify all the necessary supported customization parameters prior to library creation however, the creation process remains the same as above to view the full list of customizations that are supported, please refer to messagelimb , located in cm/core/library/librarylimb cm updating message banners we recognize the need to provide more state control on the message banners that already exist within your toolboxes for example, updating an existing toolbox message banner with a new message, or transitioning from a message type to another thus, various updating methods have been included and can be utilized (i e , within callbacks) to achieve such behavior with these methods, it reduces the need to introduce additional message banners to accommodate for multiple states, which could be troublesome to manage some example methods are as follow cm // set and update message type of message banners setmessagetype(messagetype type) { } // update message of message banners updatemessage(str message) { } // update message of message banners with additional customization updatemessage(str message, 	 image image=null, 	 brush brush=null, 	 framestyle framestyle=null, 	 color textcolor=black, 	 int textsize=12, 	 str fontface=null) { } // update styles of message banners updatestyle(image image=null, 	 brush brush=null, 	 framestyle framestyle=null) { } to view the most updated list of methods available, please refer to messagewindow , located in cm/core/toolbox/messagewindow\ cm