Skip to content

Commit

Permalink
localize RectifyStart
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaProductions committed Jan 6, 2024
1 parent 34b096a commit df066ff
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
Binary file modified RectifyStart/RectifyStart.aps
Binary file not shown.
16 changes: 13 additions & 3 deletions RectifyStart/RectifyStart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,24 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
NativeHWNDHost::Create(
(UCString)L"Rectify11", NULL,
LoadIconW(hInstance, MAKEINTRESOURCE(IDI_RECTIFYSTART)),
600, 400, 880, 720,
WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW | WS_VISIBLE, 0, &pwnd);
CW_USEDEFAULT, CW_USEDEFAULT, 880, 720,
0, WS_EX_TOOLWINDOW | WS_VISIBLE, 0, &pwnd);

static HWND hwnd = pwnd->GetHWND();
// Center the window on the screen
RECT rc;

GetWindowRect(hwnd, &rc);

int xPos = (GetSystemMetrics(SM_CXSCREEN) - rc.right) / 2;
int yPos = (GetSystemMetrics(SM_CYSCREEN) - rc.bottom) / 2;

SetWindowPos(hwnd, 0, xPos, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);

// Create DirectUI Parser
DUIXmlParser* pParser = NULL;

DUIXmlParser::Create(&pParser, NULL, NULL, NULL, NULL);
static HWND hwnd = pwnd->GetHWND();
pParser->SetParseErrorCallback(
[](UCString err1, UCString err2, int unk, void* ctx) {
MessageBox(hwnd, std::format(L"err: {}; {}; {}\n", (LPCWSTR)err1, (LPCWSTR)err2, unk).c_str(),
Expand Down
Binary file modified RectifyStart/RectifyStart.rc
Binary file not shown.
17 changes: 16 additions & 1 deletion RectifyStart/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@
#define IDC_MYICON 2
#define IDD_RECTIFYSTART_DIALOG 102
#define IDS_APP_TITLE 103
#define IDC_RECTIFYSTART 106
#define IDS_WHATSNEW 106
#define IDI_RECTIFYSTART 107
#define IDS_NEWCPL 107
#define IDI_SMALL 108
#define IDC_RECTIFYSTART 109
#define IDS_NEWCPLDESC 108
#define IDS_CHECKITOUT 109
#define IDS_THEMESWITCH 110
#define IDS_THEMESWITCHDESC 111
#define IDS_TURNON 112
#define IDS_ALREADYON 113
#define IDS_SMOOTHUI 114
#define IDS_SMOOTHUIDESC 115
#define IDS_CARD 116
#define IDS_CARDDESC 117
#define IDS_STARTUP 118
#define IDS_STRING119 119
#define IDS_CLOSE 119
#define IDR_MAINFRAME 128
#define IDR_UIFILE1 129
#define IDR_UIFILE 130
Expand Down
32 changes: 16 additions & 16 deletions RectifyStart/uifile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<stylesheets>
<!-- ressheet(ImmersiveStyles, library(dui70.dll), Dark) -->
<style resid="SXStyles">
<HWNDElement width="880rp" accessible="true" layoutpos="client" background="themeable(gtc(DirectUI::ItemsView, 0, 0, 3802), window)"/>
<HWNDElement width="880rp" height="720rp" accessible="true" layoutpos="client" background="themeable(gtc(DirectUI::ItemsView, 0, 0, 3802), window)"/>
<if id="atom(ElementContainer)">
<element padding="rect(24rp,0rp,24rp,24rp)"/>
</if>
Expand Down Expand Up @@ -55,10 +55,10 @@
<RichText background="argb(0,0,0,0)" foreground="gtc(ControlPanelStyle,8,0,3803)" font="messagefont" width="288rp" contentalign="wrapleft" margin="rect(0,0,0,12rp)"/>
</if>
<if class="ImageHolder">
<Element width="294rp" height="184rp" background="sgraphic(1000,7,-1,0,0,1,1)" padding="rect(21rp,16rp,21rp,26rp)"/>
<Element width="294rp" height="185rp" background="sgraphic(1000,7,-1,0,0,1,1)" padding="rect(21rp,16rp,21rp,27rp)"/>
</if>
<if class="Image">
<Element width="252rp" height="142rp"/>
<Element width="252rp" height="142rp" direction="ltr"/>
</if>
</style>
<style resid="RefDui" base="ressheet(ImmersiveStyles, library(dui70.dll), Dark)"/>
Expand Down Expand Up @@ -170,7 +170,7 @@
</stylesheets>
<HWNDElement resid="WizardMain" layout="FillLayout()" id="Atom(SXWizard)" sheet="SXStyles">
<element layout="borderlayout()" id="atom(ElementContainer)">
<RichText layoutpos="top" class="WizardPageTitle" id="Atom(SXTitle)" content="What's new in v3.2" font="messagefont;192%;semibold" foreground="themeable(gtc(DirectUI::ItemsView, 0, 0, 3803), windowtext)" padding="rect(0rp,16rp,0rp,0rp)"/>
<RichText layoutpos="top" class="WizardPageTitle" id="Atom(SXTitle)" content="resstr(106)" font="messagefont;192%;semibold" foreground="themeable(gtc(DirectUI::ItemsView, 0, 0, 3803), windowtext)" padding="rect(0rp,16rp,0rp,0rp)"/>
<!--element layoutpos="top" class="WizardPageSubTitle" id="Atom(SXSubTitle)" content="This is subtitle, or instruction, or body text."/-->
<element layoutpos="client" class="WizardPageContainer" layout="GridLayout(2,2)" id="Atom(SXWizardPageContainer)">
<TouchButton id="atom(Card1)" class="Card" layout="flowlayout(0,0,2,0)">
Expand All @@ -179,9 +179,9 @@
<Element class="Image" id="atom(Image1)" background="sgraphic(1001,7,-1,0,0,1,1)"/>
</Element>
<Element layout="verticalflowlayout(0,0,0,0)">
<RichText content="The new Rectify11 Settings" class="CardTitle"/>
<RichText content="Rectify11 Settings is a convenient place to change and tweak everything about Rectify11." class="CardSubtitle"/>
<TouchButton content="Check it out" class="default" sheet="CustomStyles" id="Atom(BtnOpenCpl)"/>
<RichText content="resstr(107)" class="CardTitle"/>
<RichText content="resstr(108)" class="CardSubtitle"/>
<TouchButton content="resstr(109)" class="default" sheet="CustomStyles" id="atom(BtnOpenCpl)"/>
</Element>
</Element>
</TouchButton>
Expand All @@ -191,9 +191,9 @@
<Element class="Image" id="atom(Image2)" background="sgraphic(1002,7,-1,0,0,1,1)"/>
</Element>
<Element layout="verticalflowlayout(0,0,0,0)">
<RichText content="Easy theme switching" class="CardTitle"/>
<RichText content="With the new Rectify11 tray icon, you can switch themes right from your taskbar." class="CardSubtitle"/>
<TouchButton content="Turn on" class="default" sheet="CustomStyles" id="Atom(BtnEnableTray)"/>
<RichText content="resstr(110)" class="CardTitle"/>
<RichText content="resstr(111)" class="CardSubtitle"/>
<TouchButton content="resstr(112)" class="default" sheet="CustomStyles"/>
</Element>
</Element>
</TouchButton>
Expand All @@ -203,8 +203,8 @@
<Element class="Image" id="atom(Image3)" background="sgraphic(1003,7,-1,0,0,1,1)"/>
</Element>
<Element layout="verticalflowlayout(0,0,0,0)">
<RichText content="Smoother UI" class="CardTitle"/>
<RichText content="Rectify11 v3.2 adds smooth animations to more Windows UI components, as well as making existing UI animations smoother." class="CardSubtitle"/>
<RichText content="resstr(114)" class="CardTitle"/>
<RichText content="resstr(115)" class="CardSubtitle"/>
</Element>
</Element>
</TouchButton>
Expand All @@ -214,17 +214,17 @@
<RichText class="CardTitle" content="Image TBD"/>
</Element>
<Element layout="verticalflowlayout(0,0,0,0)">
<RichText content="Title TBD" class="CardTitle"/>
<RichText content="Description TBD" class="CardSubtitle"/>
<RichText content="resstr(116)" class="CardTitle"/>
<RichText content="resstr(117)" class="CardSubtitle"/>
</Element>
</Element>
</TouchButton>
</element>
<RichText id="atom(Link)" foreground="20005" content="View full changelog" font="iconfont;115%" layoutpos="bottom" margin="rect(0,0rp,0,0)" width="160rp" visible="false"/>
</element>
<element layoutpos="bottom" class="WizardButtonBar" contentalign="middleright" layout="BorderLayout()" id="Atom(SXWizardButtonBar)">
<TouchCheckBox accessible="true" layoutpos="left" sheet="CustomStyles" checkedstate="checked" padding="rect(0,6rp,0,0)" id="Atom(SXWizardCheckbox)" active="mouse | keyboard" content="Show this window when Windows starts."/>
<TouchButton accessible="true" layoutpos="right" minsize="size(96rp,32rp)" margin="rect(6rp,0rp,0rp,0rp)" sheet="CustomStyles" accrole="pushbutton" id="Atom(SXWizardDefaultButton)" active="mouse | keyboard" content="Close"/>
<TouchCheckBox accessible="true" layoutpos="left" sheet="CustomStyles" checkedstate="checked" padding="rect(0,6rp,0,0)" id="Atom(SXWizardCheckbox)" active="mouse | keyboard" content="resstr(118)"/>
<TouchButton accessible="true" layoutpos="right" minsize="size(96rp,32rp)" margin="rect(6rp,0rp,0rp,0rp)" sheet="CustomStyles" accrole="pushbutton" id="Atom(SXWizardDefaultButton)" active="mouse | keyboard" content="resstr(119)"/>
</element>
</HWNDElement>
</duixml>

0 comments on commit df066ff

Please sign in to comment.