BOOL GBOamView::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_OAM_VIEW, DS_SizeX | DS_SizeY ) DIALOG_SIZER_ENTRY( IDC_OAM_VIEW_ZOOM, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_COLOR, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_R, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_G, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_B, DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, _T("Software\\Emulators\\VisualBoyAdvance\\Viewer\\GBOamView"), NULL); m_sprite.SetWindowText(_T("0")); updateScrollInfo(); m_stretch = regQueryDwordValue(_T("GBOamViewStretch"), 0); if(m_stretch) oamView.setStretch(true); UpdateData(FALSE); paint(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL AccelEditor::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_STATIC1, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_STATIC2, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_STATIC3, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY( IDC_ALREADY_AFFECTED, DS_MoveY) DIALOG_SIZER_ENTRY( ID_OK, DS_MoveX) DIALOG_SIZER_ENTRY( ID_CANCEL, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_ASSIGN, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_REMOVE, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_RESET, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_COMMANDS, DS_SizeX | DS_SizeY) DIALOG_SIZER_ENTRY( IDC_CURRENTS, DS_MoveX | DS_SizeY) DIALOG_SIZER_ENTRY( IDC_EDIT_KEY, DS_MoveX | DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\AccelEditor", NULL); InitCommands(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL Logging::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_LOG, DS_SizeY|DS_SizeX) DIALOG_SIZER_ENTRY( ID_OK, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLEAR, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\LogView", NULL); m_swi = (systemVerbose & 1) != 0; m_unaligned_access = (systemVerbose & 2) != 0; m_illegal_write = (systemVerbose & 4) != 0; m_illegal_read = (systemVerbose & 8) != 0; m_dma0 = (systemVerbose & 16) != 0; m_dma1 = (systemVerbose & 32) != 0; m_dma2 = (systemVerbose & 64) != 0; m_dma3 = (systemVerbose & 128) != 0; m_undefined = (systemVerbose & 256) != 0; m_agbprint = (systemVerbose & 256) != 0; UpdateData(FALSE); m_log.LimitText(-1); m_log.SetWindowText(text); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL AccelEditor::OnInitDialog(LPARAM) { DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_STATIC1, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_STATIC2, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_STATIC3, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY( IDC_ALREADY_AFFECTED, DS_MoveY) DIALOG_SIZER_ENTRY( ID_OK, DS_MoveX) DIALOG_SIZER_ENTRY( ID_CANCEL, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_ASSIGN, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_REMOVE, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_RESET, DS_MoveX) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_COMMANDS, DS_SizeX | DS_SizeY) DIALOG_SIZER_ENTRY( IDC_CURRENTS, DS_MoveX | DS_SizeY) DIALOG_SIZER_ENTRY( IDC_EDIT_KEY, DS_MoveX | DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\AccelEditor", NULL); m_Key.SubClassDlgItem(IDC_EDIT_KEY, this); InitCommands(); return TRUE; }
BOOL AccelEditor::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START(sz) DIALOG_SIZER_ENTRY(ID_OK, DS_MoveX) DIALOG_SIZER_ENTRY(ID_CANCEL, DS_MoveX) DIALOG_SIZER_ENTRY(IDC_ACCELEDIT_APPLY, DS_MoveX) DIALOG_SIZER_ENTRY(IDC_ASSIGN, DS_MoveX) DIALOG_SIZER_ENTRY(IDC_REMOVE, DS_MoveX) DIALOG_SIZER_ENTRY(IDC_ACCELEDIT_REPLACE, DS_MoveX) DIALOG_SIZER_ENTRY(IDC_COMMANDS, DS_SizeX | DS_SizeY) DIALOG_SIZER_ENTRY(IDC_CURRENTS, DS_MoveX | DS_SizeY) DIALOG_SIZER_ENTRY(IDC_EDIT_KEY, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_EDIT_KEY, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_STATIC2, DS_MoveY) DIALOG_SIZER_ENTRY(IDC_STATIC3, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_STATIC4, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_STATIC5, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_ACCELEDIT_AUTOTIMEOUT, DS_SizeX | DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\AccelEditor", NULL); if (m_pExtMgr) m_result = m_mgr = *m_pExtMgr; m_currents.SetExtendedStyle(LVS_EX_FULLROWSELECT); m_currents.InsertColumn(0, "Keys"); m_currents.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER); InitCommands(); m_autoMode = AUTO_REPLACE; m_modified = FALSE; m_timeoutValue = 1000; CString timeoutStr; timeoutStr.Format("%d", m_timeoutValue); m_timeout.SetWindowText(timeoutStr); m_progress.SetPos(0); GetDlgItem(IDC_ACCELEDIT_APPLY)->EnableWindow(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL Disassemble::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_DISASSEMBLE, DS_SizeY) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_NEXT, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_AUTO_UPDATE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_GOPC, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_VSCROLL, DS_SizeY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\DisassembleView", NULL); SCROLLINFO si; ZeroMemory(&si, sizeof(si)); si.cbSize = sizeof(si); si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; si.nMin = 0; si.nMax = 100; si.nPos = 50; si.nPage = 0; GetDlgItem(IDC_VSCROLL)->SetScrollInfo(SB_CTL, &si, TRUE); CFont *font = CFont::FromHandle((HFONT)GetStockObject(SYSTEM_FIXED_FONT)); m_list.SetFont(font, FALSE); for(int i = 0; i < 17; i++) GetDlgItem(IDC_R0+i)->SetFont(font, FALSE); GetDlgItem(IDC_MODE)->SetFont(font, FALSE); m_address.LimitText(8); refresh(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL GBMapView::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_MAP_VIEW, DS_SizeX | DS_SizeY ) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_COLOR, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_R, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_G, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_B, DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\GBMapView", NULL); int s = regQueryDwordValue("mapViewStretch", 0); if(s) mapView.setStretch(true); ((CButton *)GetDlgItem(IDC_STRETCH))->SetCheck(s); UINT id = IDC_BANK_0; if(bank == 1) id = IDC_BANK_1; CheckRadioButton(IDC_BANK_0, IDC_BANK_1, id); id = IDC_BG0; if(bg == 1) id = IDC_BG1; CheckRadioButton(IDC_BG0, IDC_BG1, id); paint(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL GBTileView::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_TILE_VIEW, DS_SizeX | DS_SizeY ) DIALOG_SIZER_ENTRY( IDC_COLOR, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_R, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_G, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_B, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\GBTileView", NULL); m_charBase = charBase; m_bank = bank; m_slider.SetRange(0, 7); m_slider.SetPageSize(2); m_slider.SetTicFreq(1); paint(); m_stretch = regQueryDwordValue("tileViewStretch", 0); if(m_stretch) tileView.setStretch(true); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL GBPaletteView::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_END() SetData(sz, FALSE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\GBPaletteView", NULL); paletteView.init(32, 64, 128); paletteViewOBJ.init(32, 64, 128); paletteView.setPaletteAddress(0); paletteView.refresh(); paletteViewOBJ.setPaletteAddress(32); paletteViewOBJ.refresh(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL GBTileViewer::OnInitDialog(LPARAM) { DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_TILE_VIEW, DS_SizeX | DS_SizeY ) DIALOG_SIZER_ENTRY( IDC_COLOR, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_R, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_G, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_B, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\GBTileView", NULL); tileView.Attach(GetDlgItem(IDC_TILE_VIEW)); zoom.Attach(GetDlgItem(IDC_MAP_VIEW_ZOOM)); color.Attach(GetDlgItem(IDC_COLOR)); DoRadio(false, IDC_CHARBASE_0, charBase); DoRadio(false, IDC_BANK_0, bank); HWND h = GetDlgItem(IDC_PALETTE_SLIDER); SendMessage(h, TBM_SETRANGE, FALSE, MAKELONG(0, 7)); SendMessage(h, TBM_SETPAGESIZE, 0, 2); SendMessage(h, TBM_SETTICFREQ, 1, 0); paint(); int s = regQueryDwordValue("tileViewStretch", 0); if(s) tileView.setStretch(true); DoCheckbox(false, IDC_STRETCH, s); return TRUE; }
BOOL MemoryViewerDlg::OnInitDialog() { CDialog::OnInitDialog(); DIALOG_SIZER_START( sz ) DIALOG_SIZER_ENTRY( IDC_VIEWER, DS_SizeX | DS_SizeY ) DIALOG_SIZER_ENTRY( IDC_REFRESH, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CLOSE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_LOAD, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_SAVE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_AUTO_UPDATE, DS_MoveY) DIALOG_SIZER_ENTRY( IDC_CURRENT_ADDRESS_LABEL, DS_MoveY | DS_MoveX) DIALOG_SIZER_ENTRY( IDC_CURRENT_ADDRESS, DS_MoveY | DS_MoveX) DIALOG_SIZER_END() SetData(sz, TRUE, HKEY_CURRENT_USER, "Software\\Emulators\\VisualBoyAdvance\\Viewer\\MemoryView", NULL); m_viewer.setDialog(this); m_viewer.ShowScrollBar(SB_VERT, TRUE); m_viewer.EnableScrollBar(SB_VERT, ESB_ENABLE_BOTH); LPCTSTR s[] = { "0x00000000 - BIOS", "0x02000000 - WRAM", "0x03000000 - IRAM", "0x04000000 - I/O", "0x05000000 - PALETTE", "0x06000000 - VRAM", "0x07000000 - OAM", "0x08000000 - ROM" }; for(int i = 0; i < 8; i++) m_addresses.AddString(s[i]); m_addresses.SetCurSel(0); RECT cbSize; int Height; m_addresses.GetClientRect(&cbSize); Height = m_addresses.GetItemHeight(-1); Height += m_addresses.GetItemHeight(0) * (9); // Note: The use of SM_CYEDGE assumes that we're using Windows '95 // Now add on the height of the border of the edit box Height += GetSystemMetrics(SM_CYEDGE) * 2; // top & bottom edges // The height of the border of the drop-down box Height += GetSystemMetrics(SM_CYEDGE) * 2; // top & bottom edges // now set the size of the window m_addresses.SetWindowPos(NULL, 0, 0, cbSize.right, Height, SWP_NOMOVE | SWP_NOZORDER); m_address.LimitText(8); m_size = regQueryDwordValue("memViewerDataSize", 0); if(m_size < 0 || m_size > 2) m_size = 0; m_viewer.setSize(m_size); UpdateData(FALSE); m_current.SetFont(CFont::FromHandle((HFONT)GetStockObject(SYSTEM_FIXED_FONT))); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
static INT_PTR CALLBACK Dialog_ChangeLanguage_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { Dialog_ChangeLanguage_Data * data; HWND langList; if (WM_INITDIALOG == msg) { DIALOG_SIZER_START(sz) DIALOG_SIZER_ENTRY(IDOK, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDCANCEL, DS_MoveX | DS_MoveY) DIALOG_SIZER_ENTRY(IDC_CHANGE_LANG_LANG_LIST, DS_SizeY | DS_SizeX) DIALOG_SIZER_END() DialogSizer_Set(hDlg, sz, TRUE); data = (Dialog_ChangeLanguage_Data*)lParam; assert(data); SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data); // for non-latin languages this depends on the correct fonts being installed, // otherwise all the user will see are squares win::SetText(hDlg, _TR("Change Language")); langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST); int itemToSelect = 0; for (int i = 0; i < trans::GetLangsCount(); i++) { const char *name = trans::GetLangNameByIdx(i); const char *langCode = trans::GetLangCodeByIdx(i); ScopedMem<WCHAR> langName(str::conv::FromUtf8(name)); ListBox_AppendString_NoSort(langList, langName); if (str::Eq(langCode, data->langCode)) itemToSelect = i; } ListBox_SetCurSel(langList, itemToSelect); // the language list is meant to be laid out left-to-right ToggleWindowStyle(langList, WS_EX_LAYOUTRTL, false, GWL_EXSTYLE); SetDlgItemText(hDlg, IDOK, _TR("OK")); SetDlgItemText(hDlg, IDCANCEL, _TR("Cancel")); CenterDialog(hDlg); SetFocus(langList); return FALSE; } switch (msg) { case WM_COMMAND: data = (Dialog_ChangeLanguage_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA); assert(data); if (HIWORD(wParam) == LBN_DBLCLK) { assert(IDC_CHANGE_LANG_LANG_LIST == LOWORD(wParam)); langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST); assert(langList == (HWND)lParam); int langIdx = (int)ListBox_GetCurSel(langList); data->langCode = trans::GetLangCodeByIdx(langIdx); EndDialog(hDlg, IDOK); return FALSE; } switch (LOWORD(wParam)) { case IDOK: { langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST); int langIdx = ListBox_GetCurSel(langList); data->langCode = trans::GetLangCodeByIdx(langIdx); EndDialog(hDlg, IDOK); } return TRUE; case IDCANCEL: EndDialog(hDlg, IDCANCEL); return TRUE; } break; } return FALSE; }