2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2011-02-24 09:25:20 +00:00
|
|
|
void pTextEdit::setCursorPosition(unsigned position) {
|
Update to v085r08 release.
byuu says:
Changelog:
- follow the Laevateinn topic to get most of it
- also added NMI, IRQ step buttons to CPU debugger
- also added trace masking + trace mask reset
- also added memory export
- cartridge loading is entirely folder-based now
FitzRoy, I'll go ahead and make a second compromise with you for v086:
I'll match the following:
/path/to/SNES.sfc/*.sfc
/path/to/NES.fc/*.prg, *.chr (split format)
/path/to/NES.fc/*.fc (merged format)
/path/to/GB.gb/*.gb
/path/to/GBC.gbc/*.gbc
Condition will be that there can only be one of each file. If there's
more than one, it'll abort. That lets me name my ROMs as
"Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg,
cartridge.chr". Or whatever you want.
We'll just go with that, see what fares out as the most popular, and
then restrict it back to that method.
The folder must have the .fc, etc extension though. That will be how we
avoid false-positive folder matches.
[Editor's note - the Laevateinn topic mentions these changes for
v085r08:
Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing,
memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu,
WRAM mirroring on breakpoints, protected MMIO memory regions
(otherwise, viewing $002100 could crash your game.)
Major missing components:
- trace mask
- trace mask clear / usage map clear
- window geometry caching / sizing improvements
- VRAM viewer
- properties viewer
- working memory export button
The rest will most likely appear after v086 is released.
]
2012-02-12 05:35:40 +00:00
|
|
|
if(position == ~0) position >>= 1; //Edit_SetSel takes signed type
|
2011-02-24 09:25:20 +00:00
|
|
|
Edit_SetSel(hwnd, position, position);
|
Update to v085r08 release.
byuu says:
Changelog:
- follow the Laevateinn topic to get most of it
- also added NMI, IRQ step buttons to CPU debugger
- also added trace masking + trace mask reset
- also added memory export
- cartridge loading is entirely folder-based now
FitzRoy, I'll go ahead and make a second compromise with you for v086:
I'll match the following:
/path/to/SNES.sfc/*.sfc
/path/to/NES.fc/*.prg, *.chr (split format)
/path/to/NES.fc/*.fc (merged format)
/path/to/GB.gb/*.gb
/path/to/GBC.gbc/*.gbc
Condition will be that there can only be one of each file. If there's
more than one, it'll abort. That lets me name my ROMs as
"Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg,
cartridge.chr". Or whatever you want.
We'll just go with that, see what fares out as the most popular, and
then restrict it back to that method.
The folder must have the .fc, etc extension though. That will be how we
avoid false-positive folder matches.
[Editor's note - the Laevateinn topic mentions these changes for
v085r08:
Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing,
memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu,
WRAM mirroring on breakpoints, protected MMIO memory regions
(otherwise, viewing $002100 could crash your game.)
Major missing components:
- trace mask
- trace mask clear / usage map clear
- window geometry caching / sizing improvements
- VRAM viewer
- properties viewer
- working memory export button
The rest will most likely appear after v086 is released.
]
2012-02-12 05:35:40 +00:00
|
|
|
Edit_ScrollCaret(hwnd);
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setEditable(bool editable) {
|
|
|
|
SendMessage(hwnd, EM_SETREADONLY, editable == false, (LPARAM)0);
|
|
|
|
}
|
|
|
|
|
2013-07-29 09:42:45 +00:00
|
|
|
void pTextEdit::setText(string text) {
|
2011-02-24 09:25:20 +00:00
|
|
|
locked = true;
|
|
|
|
string output = text;
|
|
|
|
output.replace("\r", "");
|
|
|
|
output.replace("\n", "\r\n");
|
|
|
|
SetWindowText(hwnd, utf16_t(output));
|
|
|
|
locked = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setWordWrap(bool wordWrap) {
|
|
|
|
//ES_AUTOHSCROLL cannot be changed after widget creation.
|
|
|
|
//As a result, we must destroy and re-create widget to change this setting.
|
2011-09-05 03:48:23 +00:00
|
|
|
orphan();
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
string pTextEdit::text() {
|
|
|
|
unsigned length = GetWindowTextLength(hwnd);
|
|
|
|
wchar_t buffer[length + 1];
|
|
|
|
GetWindowText(hwnd, buffer, length + 1);
|
|
|
|
buffer[length] = 0;
|
2011-03-17 12:49:46 +00:00
|
|
|
string text = (const char*)utf8_t(buffer);
|
2011-02-24 09:25:20 +00:00
|
|
|
text.replace("\r", "");
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::constructor() {
|
|
|
|
hwnd = CreateWindowEx(
|
|
|
|
WS_EX_CLIENTEDGE, L"EDIT", L"",
|
Update to v085r08 release.
byuu says:
Changelog:
- follow the Laevateinn topic to get most of it
- also added NMI, IRQ step buttons to CPU debugger
- also added trace masking + trace mask reset
- also added memory export
- cartridge loading is entirely folder-based now
FitzRoy, I'll go ahead and make a second compromise with you for v086:
I'll match the following:
/path/to/SNES.sfc/*.sfc
/path/to/NES.fc/*.prg, *.chr (split format)
/path/to/NES.fc/*.fc (merged format)
/path/to/GB.gb/*.gb
/path/to/GBC.gbc/*.gbc
Condition will be that there can only be one of each file. If there's
more than one, it'll abort. That lets me name my ROMs as
"Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg,
cartridge.chr". Or whatever you want.
We'll just go with that, see what fares out as the most popular, and
then restrict it back to that method.
The folder must have the .fc, etc extension though. That will be how we
avoid false-positive folder matches.
[Editor's note - the Laevateinn topic mentions these changes for
v085r08:
Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing,
memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu,
WRAM mirroring on breakpoints, protected MMIO memory regions
(otherwise, viewing $002100 could crash your game.)
Major missing components:
- trace mask
- trace mask clear / usage map clear
- window geometry caching / sizing improvements
- VRAM viewer
- properties viewer
- working memory export button
The rest will most likely appear after v086 is released.
]
2012-02-12 05:35:40 +00:00
|
|
|
WS_CHILD | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_WANTRETURN | (textEdit.state.wordWrap == false ? WS_HSCROLL | ES_AUTOHSCROLL : 0),
|
2013-11-28 10:29:01 +00:00
|
|
|
0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0
|
2011-02-24 09:25:20 +00:00
|
|
|
);
|
|
|
|
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&textEdit);
|
|
|
|
setDefaultFont();
|
|
|
|
setCursorPosition(textEdit.state.cursorPosition);
|
|
|
|
setEditable(textEdit.state.editable);
|
|
|
|
setText(textEdit.state.text);
|
2011-09-05 03:48:23 +00:00
|
|
|
synchronize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::destructor() {
|
|
|
|
textEdit.state.text = text();
|
|
|
|
DestroyWindow(hwnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::orphan() {
|
|
|
|
destructor();
|
|
|
|
constructor();
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pTextEdit::onChange() {
|
|
|
|
if(locked) return;
|
|
|
|
if(textEdit.onChange) textEdit.onChange();
|
|
|
|
}
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|