void CXTPSkinObjectFrame::DrawFrame(CDC* pDC) { if (m_bLockFrameDraw) return; CXTPWindowRect rc(this); rc.OffsetRect(-rc.TopLeft()); GetSchema()->DrawThemeFrame(pDC, this); if (m_spi[SB_VERT].fVisible || m_spi[SB_HORZ].fVisible) { if (m_spi[SB_VERT].fVisible) { if (!m_pSBTrack || !m_pSBTrack->bTrackThumb) SetupScrollInfo(&m_spi[SB_VERT]); CXTPBufferDCEx dcMem(*pDC, m_spi[SB_VERT].rc); DrawScrollBar(&dcMem, &m_spi[SB_VERT]); } if (m_spi[SB_HORZ].fVisible) { if (!m_pSBTrack || !m_pSBTrack->bTrackThumb) SetupScrollInfo(&m_spi[SB_HORZ]); CXTPBufferDCEx dcMem(*pDC, m_spi[SB_HORZ].rc); DrawScrollBar(&dcMem, &m_spi[SB_HORZ]); } if (m_spi[SB_HORZ].fVisible && m_spi[SB_VERT].fVisible) { CRect rcSizeGripper(m_spi[SB_HORZ].rc.right, m_spi[SB_VERT].rc.bottom, m_spi[SB_VERT].rc.right, m_spi[SB_HORZ].rc.bottom); if (GetExStyle() & WS_EX_LEFTSCROLLBAR) { rcSizeGripper.left = m_spi[SB_VERT].rc.left; rcSizeGripper.right = m_spi[SB_HORZ].rc.left; } pDC->FillSolidRect(rcSizeGripper, GetSchema()->GetScrollBarSizeBoxColor(this)); if (IsSizeBox()) { CXTPSkinManagerClass* pClassScrollBar = GetSkinManager()->GetSkinClass(this, _T("SCROLLBAR")); pClassScrollBar->DrawThemeBackground(pDC, SBP_SIZEBOX, SZB_RIGHTALIGN, rcSizeGripper); } } } }
void ListPage::DrawFooterAndScrollBar() { if (m_dwFlags & LF_SCROLLBAR) DrawScrollBar(); if (m_dwFlags & LF_SHOW_FOOTER) DrawFooter(); }
void ListControl::OnPaint(Canvas &canvas) { if (item_renderer != nullptr) DrawItems(canvas, origin, origin + items_visible + 2); DrawScrollBar(canvas); }
/* * Cheats Codes Selection Menu */ void DrawGameList(int selIndex, struct game_entry * games, int glen, u8 alpha) { SetFontSize(14, 16); SetCurrentFont(font_comfortaa_regular); int game_y = 80, y_inc = 20; int maxPerPage = (512 - (game_y * 2)) / y_inc; int x = selIndex - (maxPerPage / 2); int max = maxPerPage + selIndex; if (max > glen) max = glen; for (; x < max; x++) { int xo = 0; //(((selIndex - x) < 0) ? -(selIndex - x) : (selIndex - x)); if (x >= 0) { u8 a = ((alpha * CalculateAlphaList(x, selIndex, maxPerPage)) / 0xFF); if (isGameActivated(games[x])) { DrawTextureCentered(menu_textures[mark_arrow_png_index], MENU_ICON_OFF + (MENU_TITLE_OFF / 2), game_y + (y_inc / 2), 0, MENU_TITLE_OFF / 3, y_inc / 2, 0xFFFFFF00 | a); } SetFontColor(0x00000000 | a, 0x00000000); if (games[x].name) { char * nBuffer = (char*)malloc(strlen(games[x].name)); strcpy(nBuffer, games[x].name); int game_name_width = 0; while ((game_name_width = WidthFromStr(nBuffer)) > 0 && (MENU_ICON_OFF + (MENU_TITLE_OFF * 1) - xo + game_name_width) > (800 - (MENU_ICON_OFF * 3) - xo)) nBuffer[strlen(nBuffer) - 1] = '\0'; DrawString(MENU_ICON_OFF + (MENU_TITLE_OFF * 1) - xo, game_y, nBuffer); free(nBuffer); } if (games[x].title_id) DrawString(800 - (MENU_ICON_OFF * 3) - xo, game_y, games[x].title_id); if (games[x].version) DrawString(800 - (MENU_ICON_OFF * 1) - xo, game_y, games[x].version); } if (x == selIndex) { int c; for (c = 0; c < 848; c++) DrawTexture(menu_textures[mark_line_png_index], c, game_y, 0, menu_textures[mark_line_png_index].texture.width, menu_textures[mark_line_png_index].texture.height, 0xFFFFFF00 | alpha); DrawTextureCenteredX(menu_textures[mark_arrow_png_index], MENU_ICON_OFF - 20, game_y, 0, (2 * y_inc) / 3, y_inc + 2, 0xFFFFFF00 | alpha); } game_y += y_inc; } DrawScrollBar(selIndex, glen, y_inc, 800, alpha); }
void ListControl::OnPaint(Canvas &canvas, const PixelRect &dirty) { if (item_renderer != nullptr) DrawItems(canvas, origin + (dirty.top + pixel_pan) / item_height, origin + (dirty.bottom + pixel_pan + item_height - 1) / item_height); DrawScrollBar(canvas); }
void Draw_CheatsMenu_Options(void) { int c = 0, w = 0, h = 0; //------------ Backgrounds Draw_CheatsMenu_Selection(menu_old_sel[5], 0xD0D0D0FF); DrawTexture(menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -marginVertical, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (marginVertical * 2), 0x000000FF); DrawHeader(menu_textures[header_ico_opt_png_index], MENU_SPLIT_OFF, "Cheat Option", selected_centry.name, 0x000000ff, 0xffffffff, 1); DrawOptions(selected_centry.options[option_index], 0xFF, 20, menu_sel); DrawScrollBar(menu_sel, selected_centry.options[option_index].size, 20, 800, 0xFF); }
void Draw_CheatsMenu_View(void) { int c = 0, w = 0, h = 0; //------------ Backgrounds Draw_CheatsMenu_Selection(menu_old_sel[5], 0xD0D0D0FF); DrawTexture(menu_textures[edit_shadow_png_index], MENU_SPLIT_OFF - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -marginVertical, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (marginVertical * 2), 0x000000FF); DrawHeader(menu_textures[header_ico_opt_png_index], MENU_SPLIT_OFF, "Cheat View", selected_centry.name, 0x000000ff, 0xffffffff, 1); int nlines = DrawCodes(selected_centry, 0xFF, 20, MENU_SPLIT_OFF, menu_sel); //DrawScrollBar2(menu_sel, nlines, 18, 700, 0xFF); DrawScrollBar(menu_sel, nlines, 20, 800, 0xFF); }
void Draw_CheatsMenu_View_Ani(void) { int c = 0, w = 0, h = 0; int div = 12, max = MENU_ANI_MAX, ani = 0, left = MENU_SPLIT_OFF; for (ani = 0; ani < max; ani++) { tiny3d_Clear(0xff000000, TINY3D_CLEAR_ALL); tiny3d_AlphaTest(1, 0x0, TINY3D_ALPHA_FUNC_GEQUAL); tiny3d_BlendFunc(1, TINY3D_BLEND_FUNC_SRC_RGB_SRC_ALPHA | TINY3D_BLEND_FUNC_SRC_ALPHA_SRC_ALPHA, 0x00000303 | 0x00000000, TINY3D_BLEND_RGB_FUNC_ADD | TINY3D_BLEND_ALPHA_FUNC_ADD); tiny3d_Project2D(); u8 icon_a = (u8)(((ani * 4 + 0x40) > 0xFF) ? 0xFF : (ani * 4 + 0x40)); left = 848 - (ani * div * 3); if (left < MENU_SPLIT_OFF) left = MENU_SPLIT_OFF; u8 rgbVal = 0xFF; rgbVal -= (u8)((848 - left) / div); if (rgbVal < 0xD0) rgbVal = 0xD0; Draw_CheatsMenu_Selection(menu_sel, (rgbVal << 24) | (rgbVal << 16) | (rgbVal << 8) | 0xFF); DrawTexture(menu_textures[edit_shadow_png_index], left - (menu_textures[edit_shadow_png_index].texture.width * 1) + 1, -marginVertical, 0, menu_textures[edit_shadow_png_index].texture.width, 512 + (marginVertical * 2), icon_a); DrawHeader(menu_textures[header_ico_opt_png_index], left, "Cheat View", selected_centry.name, 0x00000000 | icon_a, 0xffffffff, 1); u8 game_a = (u8)(icon_a < 0x8F ? 0 : icon_a); int nlines = DrawCodes(selected_centry, game_a, 20, left, menu_old_sel[6]); DrawScrollBar(menu_old_sel[6], nlines, 20, 800, game_a); tiny3d_Flip(); if ((848 - (ani * div * 3)) < (MENU_SPLIT_OFF / 2)) return; } }
void ListControl::SetOrigin(int i) { if (length <= items_visible) return; if (i < 0) i = 0; else if ((unsigned)i + items_visible > length) i = length - items_visible; if ((unsigned)i == origin) return; #ifdef USE_GDI int delta = origin - i; #endif origin = i; #ifdef USE_GDI if ((unsigned)abs(delta) < items_visible) { PixelRect rc = GetClientRect(); rc.right = scroll_bar.GetLeft(GetSize()); Scroll(0, delta * item_height, rc); /* repaint the scrollbar synchronously; we could Invalidate its area and repaint asynchronously via WM_PAINT, but then the clip rect passed to OnPaint() would be the whole client area */ WindowCanvas canvas(*this); DrawScrollBar(canvas); return; } #endif Invalidate(); }
void DrawCheatsList(int selIndex, struct game_entry game, u8 alpha) { SetFontSize(14, 16); int game_y = 80, y_inc = 20; int maxPerPage = (512 - (game_y * 2)) / y_inc; int x = selIndex - (maxPerPage / 2); int max = maxPerPage + selIndex; if (max > game.code_count) max = game.code_count; for (; x < max; x++) { int xo = 0; //(((selIndex - x) < 0) ? -(selIndex - x) : (selIndex - x)); if (x >= 0 && game.codes[x].name) { //u32 color = game.codes[x].activated ? 0x4040C000 : 0x00000000; u8 a = (u8)((alpha * CalculateAlphaList(x, selIndex, maxPerPage)) / 0xFF); SetFontColor(0x00000000 | a, 0x00000000); //printf ("Drawing code name %d\n", x); SetCurrentFont(font_comfortaa_regular); float dx = DrawString(MENU_ICON_OFF + (MENU_TITLE_OFF * 3) - xo, game_y, game.codes[x].name); //DrawString(MENU_ICON_OFF + (MENU_TITLE_OFF * 3), game_y, game.codes[x].name); if (game.codes[x].activated) { DrawTexture(menu_textures[cheat_png_index], MENU_ICON_OFF, game_y, 0, (MENU_TITLE_OFF * 3) - 15, y_inc + 2, 0xFFFFFF00 | a); SetFontSize((int)(y_inc * 0.6), (int)(y_inc * 0.6)); SetFontAlign(3); //SetCurrentFont(font_comfortaa_light); SetFontColor(0xFFFFFF00 | a, 0); DrawString(MENU_ICON_OFF + ((MENU_TITLE_OFF * 3) - 15) / 2, game_y + 2, game.codes[x].cwrite ? "constant" : "once"); SetFontAlign(0); SetFontSize(14, 16); if (game.codes[x].options_count > 0 && game.codes[x].options) { int od = 0; for (od = 0; od < game.codes[x].options_count; od++) { if (game.codes[x].options[od].sel >= 0 && game.codes[x].options[od].name && game.codes[x].options[od].name[game.codes[x].options[od].sel]) { SetCurrentFont(font_comfortaa_bold); //Allocate option char * option = malloc(strlen(game.codes[x].options[od].name[game.codes[x].options[od].sel]) + 4); memset(option, 0, sizeof(option)); //If first print "(NAME", else add to list of names ", NAME" sprintf(option, (od == 0) ? " (%s" : ", %s", game.codes[x].options[od].name[game.codes[x].options[od].sel]); //If it's the last one then end the list if (od == (game.codes[x].options_count - 1)) option[strlen(option)] = ')'; SetFontColor(0x00000000 | a, 0x00000000); dx = DrawString(dx, game_y, option); free (option); } } } } } if (x == selIndex) { //Draw selection bar int c = 0; for (c = 0; c < 848; c++) DrawTexture(menu_textures[mark_line_png_index], c, game_y, 0, menu_textures[mark_line_png_index].texture.width, menu_textures[mark_line_png_index].texture.height, 0xFFFFFF00 | alpha); DrawTextureCenteredX(menu_textures[mark_arrow_png_index], MENU_ICON_OFF - 20, game_y, 0, (2 * y_inc) / 3, y_inc + 2, 0xFFFFFF00 | alpha); } game_y += y_inc; } DrawScrollBar(selIndex, game.code_count, y_inc, 800, alpha); }