Use of common labels on the MiniGUI skin Interface

Source: Internet
Author: User
In skindemo. C does not use common labels. It took some time to study it. The key is the assignment of fonts members in the structure of the skin interface. The key code is as follows: static si_nrmlabel_t Title = {"hello", 0xdd0000, 0x00ff00, 0xff0000, 0}; static skin_item_t skin_main_items [] =
{
{Siid_title, si_type_nrmlabel | si_test_shape_rect | si_status_visible,
15, 0, {},-1, "title", 0, & Title},};/* bytes resource loading/uninstalling function */
Void load_skin_fonts (skin_head_t * skin, bool load)
{
Int font_num = 2;
Logfont * my_logfont;
 
If (load)
{
Skin-> fonts = (logfont *) calloc (font_num, sizeof (logfont ));
My_logfont = createlogfont (null, "Song", "gb2312 ",
Font_weight_regular, font_slant_roman, font_setwidth_normal,
Font_spacing_charcell, font_underline_none, font_struckout_none, 12, 0 );
Memcpy (void *) & skin-> fonts [0], (void *) my_logfont, sizeof (logfont ));
Destroylogfont (my_logfont);/* release font */my_logfont = createlogfont (null, "sansserif", "ISO8859-1 ",
Font_weight_regular, font_slant_italic, font_setwidth_normal,
Font_spacing_charcell, font_underline_none, font_struckout_line,

16, 0 );
Memcpy (void *) & skin-> fonts [1], (void *) my_logfont, sizeof (logfont ));
Destroylogfont (my_logfont);/* release the font */
}
Else
{
Free (void *) Skin-> fonts );
}
}

Then, call it in the main function to complete the uninstallation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.