Encapsuler la création des composants graphiques de la LIB2D de cryonetworks en utilisant des ressources graphiques standardisées dans un fichier de thème (.THM).
Pour fonctionner, la librairie a besoin des fichiers suivants :
- GRAPHICDRESSING.PKG
- TITLEBAR.PKG
- PROTOGRAPHICDRESSING.PKG
- CREATEWINDOW.PKG
- un fichier thème (par exemple SCS.THM)
- Les ressources graphiques au format PNG correspondant au thème.
Ce package a été conçu de manière à faciliter au maximum la migration des interfaces basées sur la LIB2D en encapsulant chaque fonction de création de composant graphique en conservant sa déclaration, hormis certains paramètres de bitmaps qui n'ont plus à être passés.
Pour utiliser cette librairie, vous devez l'initialiser une fois pour toute, et ce avant toute utilisation de vos ressources graphiques. Typiquement, il faut appeler la fonction GRAPHICDRESSING_InitDressing() dans le point d'entrée de votre projet. Enfin, vous devez ensuite modifier le code de cette fonction pour positionner certaines variables (cf tableau ci-dessous).
D'autre part, il est important si vous créez des composants de les détruire proprement si vous n'en avez plus besoin en appelant les fonctions correspondantes.
Exemples :
En pratique et de manière générale, il suffit de préfixer toutes les fonctions de création ou destruction de la LIB2D par le mot clef "GRAPHICDRESSING_" et d'enlever les derniers paramètres concernant les bitmaps de ressources. Les fonctions de dissimulation ou d'apparition d'éléments sont présentes et ont été simplifiées.
Voici les fonctions publiques disponibles à l'utilisation. Leur fonctionnement correct est assujetti à la qualité de votre fichier de thème, qui doit recenser toutes les ressources graphiques de votre application de manière précise en suivant le format communément admis. Le fichier SCS.THM est un bon exemple de fichier de thème valide.
|
Entry point of whole GraphicDressing package : must be called within your project at an early state, for instance in your entry point function. Must be followed when needed by a call to these functions, in order to set the proper default variables : - GRAPHICDRESSING_SetBackgroundColor
|
|
Sets the default background color used when creating graphic components ; Typically this info is extracted automatically from the Theme file within the GRAPHICDRESSING_SetTheme function call. |
|
Sets the current directory path where bitmap files are to be found. Typically this info is extracted automatically from the Theme file within the GRAPHICDRESSING_SetTheme function call. |
|
Sets the default font to be used when displaying text within graphic components. The call to this function is optional since a default font is set in GRAPHICDRESSING_InitDressing to Arial, 14, normal. |
|
Sets the default events to pass to the container upon components creation - This argument will be passed as the lib2d filtrageflags parameter. |
|
Sets the default handler function for text locale resolution, of form fun [S key [S param r1]] S. A default locale function is provided which simply returns the string "Locale error". You should then call this function with your own locale function handler. |
|
Sets the default transparency color used when loading bitmap files to be blitted onto graphic components ; Typically this info is extracted automatically from the Theme file within the GRAPHICDRESSING_SetTheme function call. |
|
Sets the current theme to work with - All further graphic dressing function will use the new theme you specify. WARNING : the call to this function must be accomplished before any attempt to use another "SET" functions, since GRAPHICDRESSING_SetTheme performs inner calls to the "SET" functions from the informations contained in theme file. |
|
Sets the default handler function for bitmap file loading, of form fun [S filepath Chn channel] AlphaBitmap. The call to this function is optional since a default function is provided - which simply returns an alphaBitmap as follows : _LDalphaBitmap channel _checkpack filepath ; |
|
Retrieves the current background color |
|
Retrieves the current default font |
|
Retrieves the events passed to the container as parameter filterflags |
|
Retrieves the current theme |
|
Retrieves the current transparency color |
|
Encapsulation of _CRcompCheck function of Lib2D |
|
Encapsulation of _CRcompCheck function of Lib2D plus a new parameter - prefix. This parameter is used to select the proper compCheck resources within the theme file, if required. |
|
Encapsulation of _CRcompCheck function of Lib2D, same as GRAPHICDRESSING_CRcompCheckCustom using the prefix "MAXI_" |
|
Encapsulation of _CRcompCheck function of Lib2D, same as GRAPHICDRESSING_CRcompCheckCustom using the prefix "MIDDLE_" |
|
Encapsulation of _CRcompCheck function of Lib2D, same as GRAPHICDRESSING_CRcompCheckCustom using the prefix "MINI_" |
|
Encapsulation of _CRcompCheck function of Lib2D, same as GRAPHICDRESSING_CRcompCheckCustom using no prefix and no background compCheck resource |
|
Encapsulation of _CRcompCheck function of Lib2D, same as GRAPHICDRESSING_CRcompCheckCustom using the prefix "OVAL_" |
|
Encapsulation of _CRcompCombo function of Lib2D. WARNING : Do not forget the last new parameter. |
|
Encapsulation of _CRcompList function of Lib2D |
|
Encapsulation of _CRcompRollOver function of Lib2D |
|
Encapsulation of _CRcompRollOver function of Lib2D, using prefix "MAXI_" to select the proper resource in theme file. |
|
Encapsulation of _CRcompRollOver function of Lib2D, using prefix "MIDDLE_" to select the proper resource in theme file. |
|
Encapsulation of _CRcompRollOver function of Lib2D, using prefix "MINI_" to select the proper resource in theme file. |
|
Encapsulation of _CRcompRollOver function of Lib2D, using prefix "OVAL_" to select the proper resource in theme file. |
|
Encapsulation of _CRcompRollOver function of Lib2D, adding a text message (given a text color and font). Width and height of Button - Text message will be centered given these values, typically defined by a call to _GETstringSize function. |
|
Encapsulation of _CRcompText function of Lib2D |
|
Encapsulation of _CRcompTree function of Lib2D |
|
Encapsulation of _CRsizeBar function of Lib2D |
|
Creates a container as follows This function creates a container with borders, title bar and buttons according to the flag passed as an argument : - Channel
- reflexes: are 3 callbacks for the three buttons (min,max,close). Returns a vector of form [cont compTitle compMin compMax compClose
_] containing : |
|
Same as GRAPHICDRESSING_CRcontainer but father represents a ObjWin. The container will be created a child window. proto : fun [Chn ObjWin [I I I I] [I I I I] I S ObjFOnt [I I I I] I [fun[]I fun[]I fun[]I] ] [ObjContainer CompText CompRollOver CompCheck CompRollOver ClientSizePos] |
|
Same as GRAPHICDRESSING_CRcontainer given an ObjWin within where the new container will be created. |
|
Creates a title bar to add to your self made containers. |
|
Creates a dialog box according to the flags passed in nCreationFlags : - GDBOXFLAGS_YESNO creates a dialog box with 2 user options as an answer : YES or NO (closing cross in the upper right hand corner means NO) - GDBOXFLAGS_YESNOCANCEL creates a dialog box with YES, NO
and CANCEL buttons (closing cross in the upper right hand corner means
CANCEL) - GDBOXFLAGS_OK creates a dialog box with a simple OK button - GDBOXFLAGS_OKCANCEL creates a dialog box with YES & CANCEL buttons (closing cross in the upper right hand corner means CANCEL) You have to specify a function callback of form fun OnCloseDialogBox(comprollover, param, posx, posy, btn, mask) to process the dialog box return value (passed as parameter param) Typically at the beginning of your callback function : let param -> [ cont retval yourparam] in where retval can be one of the following values : - GDBOX_YES |
|
Creates a simple dialog box which displays your text message. No callback function will be called upon the dialog box closing. |
|
Destroy the graphic component given as parameter. |
|
Call this function to make visible or to hide a graphic component. IN parameters : - compobj (the compobj object you want to make visible or invisible - bool (bool is a boolean value : TRUE if component must become visible, FALSE otherwise ) RETURN VALUE : returns bool |
File last revision : October, 8th 2000.