ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static VOID AdvAppearanceDlg_Init ( HWND  hwndDlg,
GLOBALS g 
) [static]

Definition at line 345 of file advappdlg.c.

Referenced by AdvAppearanceDlgProc().

{
    INT i, iElement, iListIndex, iDeskIndex = 0;
    TCHAR tstrText[80];
    LOGFONT lfFont;
    LOGFONT lfButtonFont;
    HFONT hMyFont;
    HDC hScreenDC;
    TCHAR Size[4];

    /* Copy the current theme values */
    g->SchemeAdv = g->Scheme;

    SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->SchemeAdv);


    /* Add the elements to the combo */
    for (iElement = 0; iElement < NUM_ELEMENTS; iElement++)
    {
        LoadString(hApplet, IDS_ELEMENT_1 + iElement, (LPTSTR)&tstrText, 79);
        iListIndex = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_ADDSTRING, 0, (LPARAM)&tstrText);
        SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_SETITEMDATA, (WPARAM)iListIndex, (LPARAM)iElement);
    }

    /* Get the list index of the desktop element */
    for (iListIndex = 0; iListIndex < NUM_ELEMENTS; iListIndex++)
    {
        iElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, (WPARAM)iListIndex, 0);
        if (iElement == 0)
        {
            iDeskIndex = iListIndex;
            break;
        }
    }

    SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_SETCURSEL, iDeskIndex, 0);

    /* Create font for bold button */
    lfButtonFont = g->Scheme.lfFont[FONT_DIALOG];
    lfButtonFont.lfWeight = FW_BOLD;
    lfButtonFont.lfItalic = FALSE;
    hMyFont = CreateFontIndirect(&lfButtonFont);
    if (hMyFont)
    {
        if (g->hBoldFont)
            DeleteObject(g->hBoldFont);

        g->hBoldFont = hMyFont;
    }

    /* Create font for italic button */
    lfButtonFont.lfWeight = FW_REGULAR;
    lfButtonFont.lfItalic = TRUE;
    hMyFont = CreateFontIndirect(&lfButtonFont);
    if (hMyFont)
    {
        if (g->hItalicFont)
            DeleteObject(g->hItalicFont);

        g->hItalicFont = hMyFont;
    }

    /* Set the fonts for the font style buttons */
    SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, WM_SETFONT, (WPARAM)g->hBoldFont, (LPARAM)TRUE);
    SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, WM_SETFONT, (WPARAM)g->hItalicFont, (LPARAM)TRUE);

    /* Draw Bitmaps for the colorbuttons */
    InitColorButtons(hwndDlg, g);

    /* Make the UpDown control count correctly */
    SendMessage(GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD), UDM_SETRANGE, 0L, MAKELONG (200, 1));

    /* Fill font selection combo */
    lfFont.lfCharSet = DEFAULT_CHARSET;
    lfFont.lfFaceName[0] = (TCHAR)0;
    lfFont.lfPitchAndFamily = 0;
    hScreenDC = GetDC(0);
    EnumFontFamiliesEx(hScreenDC, &lfFont, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)GetDlgItem(hwndDlg, IDC_ADVAPPEARANCE_FONT_C), 0);
    ReleaseDC(0, hScreenDC);

    /* Fill font size combo */
    for (i = 6; i <= 24; i++)
    {
        wsprintf(Size, TEXT("%d"), i);
        SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, CB_ADDSTRING, 0, (LPARAM)&Size);
    }

    /* Update the controls */
    iListIndex = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETCURSEL, 0, 0);
    g->CurrentElement = SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_ELEMENT, CB_GETITEMDATA, (WPARAM)iListIndex, 0);
    UpdateControls(hwndDlg, g);
}

Generated on Mon May 28 2012 05:00:36 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.