2015-06-12 13:14:38 +00:00
|
|
|
#if defined(Hiro_Label)
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
namespace hiro {
|
|
|
|
|
|
|
|
auto pLabel::construct() -> void {
|
|
|
|
hwnd = CreateWindow(L"hiroLabel", L"",
|
|
|
|
WS_CHILD,
|
|
|
|
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0);
|
|
|
|
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&reference);
|
|
|
|
pWidget::_setState();
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
setAlignment(state().alignment);
|
2015-06-12 13:14:38 +00:00
|
|
|
setText(state().text);
|
2011-03-22 12:56:49 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pLabel::destruct() -> void {
|
|
|
|
DestroyWindow(hwnd);
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pLabel::minimumSize() const -> Size {
|
Update to v100 release.
byuu says:
higan has finally reached v100!
I feel it's important to stress right away that this is not "version
1.00", nor is it a major milestone release. Rather than arbitrary version
numbers, all of my software simply bumps version numbers by one for each
official release. As such, higan v100 is simply higan's 100th release.
That said, the primary focus of this release has been code
clean-ups. These are always somewhat dangerous in that regressions are
possible. We've tested through sixteen WIP revisions, one of which was
open to the public, to try and minimize any regressions. But all the same,
please report any regressions if you discover any.
Changelog (since v099):
FC: render during pixels 1-256 instead of 0-255 [hex_usr]
FC: rewrote controller emulation code
SFC: 8% speedup over the previous release thanks to PPU optimizations
SFC: fixed nasty DB address wrapping regression from v099
SFC: USART developer controller removed; superseded by 21fx
SFC: Super Multitap option removed from controller port 1; ports
renamed 2-5
SFC: hidden option to experiment with 128KB VRAM (strictly for novelty)
higan: audio volume no longer divided by number of audio streams
higan: updated controller polling code to fix possible future mapping
issues
higan: replaced nall/stream with nall/vfs for file-loading subsystem
tomoko: can now load multi-slotted games via command-line
tomoko: synchronize video removed from UI; still available in the
settings file
tomoko, icarus: can navigate to root drive selection on Windows
all: major code cleanups and refactoring (~1MB diff against v099)
Note 1: the audio volume change means that SGB and MSU1 games won't
lose half the volume on the SNES sounds anymore. However, if one goes
overboard and drives the sound all the way to max volume with the MSU1,
clamping may occur. The obvious solution is not to drive volume that high
(it will vastly overpower the SNES audio, which usually never exceeds
25% volume.) Another option is to lower the volume in the audio settings
panel to 50%. In general, neither is likely to ever be necessary.
Note 2: the synchronize video option was hidden from the UI because it
is no longer useful. With the advent of compositors, the loss of the
complicated timing settings panel, support for the WonderSwan and its
75hz display, the need to emulate variable refresh rate behaviors in the
Game Boy, the unfortunate latency spike and audio distortion caused by
long Vsync pauses, and the arrival of adaptive sync technology ... it
no longer makes sense to present this option. However, as stated, you
can edit settings.bml to enable this option anyway if you insist and
understand the aforementioned risks.
Changelog (since v099r16 open beta):
- fixed MSU1 audio sign extension
- fixed compilation with SGB support disabled
- icarus can now navigate to root directory
- fixed compilation issues with OS X port
- (hopefully) fixed label height issue with hiro that affected icarus
import dialog
- (mostly) fixed BS Memory, Sufami Turbo slot loading
Errata:
- forgot to remove the " - Slot A", " - Slot B" suffixes for Sufami
Turbo slot loading
- this means you have to navigate up one folder and then into Sufami
Turbo/ to load games for this system
- moving WonderSwan orientation controls to the device slot is causing
some nastiness
- can now select orientation from the main menu, but it doesn't rotate
the display
2016-07-08 12:04:32 +00:00
|
|
|
auto size = pFont::size(self().font(true), state().text ? state().text : " ");
|
2015-06-12 13:14:38 +00:00
|
|
|
return {size.width(), size.height()};
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
auto pLabel::setAlignment(Alignment alignment) -> void {
|
|
|
|
InvalidateRect(hwnd, 0, false);
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto pLabel::setText(const string& text) -> void {
|
|
|
|
SetWindowText(hwnd, utf16_t(text));
|
|
|
|
InvalidateRect(hwnd, 0, false);
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
static auto CALLBACK Label_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
|
|
|
auto label = (mLabel*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
|
|
|
if(!label) return DefWindowProc(hwnd, msg, wparam, lparam);
|
|
|
|
auto window = label->parentWindow(true);
|
|
|
|
if(!window) return DefWindowProc(hwnd, msg, wparam, lparam);
|
2011-02-24 09:25:20 +00:00
|
|
|
|
2013-11-28 10:32:53 +00:00
|
|
|
switch(msg) {
|
|
|
|
case WM_GETDLGCODE: return DLGC_STATIC | DLGC_WANTCHARS;
|
2015-06-12 13:14:38 +00:00
|
|
|
case WM_ERASEBKGND: return true;
|
2013-11-28 10:32:53 +00:00
|
|
|
case WM_PAINT: {
|
2011-02-24 09:25:20 +00:00
|
|
|
PAINTSTRUCT ps;
|
|
|
|
BeginPaint(hwnd, &ps);
|
2013-11-28 10:32:53 +00:00
|
|
|
RECT rc;
|
2011-02-24 09:25:20 +00:00
|
|
|
GetClientRect(hwnd, &rc);
|
2016-08-08 10:04:15 +00:00
|
|
|
//todo: use DrawThemeParentBackground if Label is inside TabFrame
|
|
|
|
if(auto brush = window->self()->hbrush) {
|
|
|
|
FillRect(ps.hdc, &rc, brush);
|
|
|
|
} else {
|
|
|
|
DrawThemeParentBackground(hwnd, ps.hdc, &rc);
|
|
|
|
}
|
2013-11-28 10:29:01 +00:00
|
|
|
SetBkMode(ps.hdc, TRANSPARENT);
|
2015-06-12 13:14:38 +00:00
|
|
|
SelectObject(ps.hdc, label->self()->hfont);
|
2016-08-08 10:04:15 +00:00
|
|
|
uint length = GetWindowTextLength(hwnd);
|
2011-02-24 09:25:20 +00:00
|
|
|
wchar_t text[length + 1];
|
|
|
|
GetWindowText(hwnd, text, length + 1);
|
|
|
|
text[length] = 0;
|
|
|
|
DrawText(ps.hdc, text, -1, &rc, DT_CALCRECT | DT_END_ELLIPSIS);
|
2016-08-08 10:04:15 +00:00
|
|
|
uint height = rc.bottom;
|
2011-02-24 09:25:20 +00:00
|
|
|
GetClientRect(hwnd, &rc);
|
|
|
|
rc.top = (rc.bottom - height) / 2;
|
|
|
|
rc.bottom = rc.top + height;
|
2016-08-08 10:04:15 +00:00
|
|
|
uint horizontalAlignment = DT_CENTER;
|
|
|
|
if(label->alignment().horizontal() < 0.333) horizontalAlignment = DT_LEFT;
|
|
|
|
if(label->alignment().horizontal() > 0.666) horizontalAlignment = DT_RIGHT;
|
|
|
|
uint verticalAlignment = DT_VCENTER;
|
|
|
|
if(label->alignment().vertical() < 0.333) verticalAlignment = DT_TOP;
|
|
|
|
if(label->alignment().vertical() > 0.666) verticalAlignment = DT_BOTTOM;
|
|
|
|
DrawText(ps.hdc, text, -1, &rc, DT_END_ELLIPSIS | horizontalAlignment | verticalAlignment);
|
2011-02-24 09:25:20 +00:00
|
|
|
EndPaint(hwnd, &ps);
|
2015-06-12 13:14:38 +00:00
|
|
|
return false;
|
2013-11-28 10:32:53 +00:00
|
|
|
}
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return DefWindowProc(hwnd, msg, wparam, lparam);
|
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
|
|
|
|
#endif
|