checkbox prototype + styles definition + more UI

This commit is contained in:
mmacierzanka committed 2021-04-18 22:38:34 +02:00
1 parent 68434a2a29
commit b885912778
3 files changed
+30 -7

No files matched your search

+15 -3
View File
@@ -20,9 +20,21 @@ WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance,
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent) {
return CreateWindowEx(WS_EX_CLIENTEDGE, windowClass.lpszClassName, windowTitle, windowStyles, CW_USEDEFAULT, CW_USEDEFAULT, windowWidth, windowHeight, parent, NULL, instance, NULL);
}
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow) {
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
if (styles == NULL) {
styles = WS_CHILD | WS_VISIBLE;
}
return CreateWindowEx(0, L"BUTTON", label, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
}
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow) {
return CreateWindowEx(0, L"STATIC", startingContent, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
if (styles == NULL) {
styles = WS_CHILD | WS_VISIBLE;
}
return CreateWindowEx(0, L"STATIC", startingContent, styles, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
}
HWND EzCreateControl(LPCWSTR type, LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles) {
if (styles == NULL) {
styles = WS_CHILD | WS_VISIBLE;
}
return CreateWindowEx(0, type, startingContent, WS_CHILD | WS_VISIBLE, posX, posY, sizeW, sizeH, mainWindow, NULL, NULL, NULL);
}
+3 -2
View File
@@ -4,6 +4,7 @@
#define FUNCTIONS_H_INCLUDED
WNDCLASSEX EzCreateClass(LPCWSTR name, WNDPROC messageLoop, HINSTANCE instance, LPCWSTR classIcon, LPCWSTR cursor);
HWND EzCreateWindow(WNDCLASSEX windowClass, HINSTANCE instance, LPCWSTR windowTitle, DWORD windowStyles, int windowWidth, int windowHeight, HWND parent);
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow);
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow);
HWND EzCreateButton(LPCWSTR label, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
HWND EzCreateLabel(LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
HWND EzCreateControl(LPCWSTR type, LPCWSTR startingContent, int posX, int posY, int sizeW, int sizeH, HWND mainWindow, DWORD styles);
#endif
+12 -2
View File
@@ -3,6 +3,11 @@
MSG msg;
HWND dirLabel;
HWND browseButton;
HWND filesList;
HWND playButton;
HWND pauseButton;
HWND npLabel;
HWND autoPlayCheck;
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -24,8 +29,13 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin
return 0;
}
void CreateControls(HWND window) {
browseButton = EzCreateButton(L"Przegl¹daj", 300, 10, 75, 30, window);
dirLabel = EzCreateLabel(L"Nie wybrano folderu", 10, 10, 275, 30, window);
dirLabel = EzCreateLabel(L"Nie wybrano folderu", 10, 10, 250, 30, window, FALSE);
browseButton = EzCreateButton(L"Przegl¹daj", 275, 10, 100, 30, window, NULL);
filesList = EzCreateControl(L"LISTBOX", NULL, 0, 50, 400, 425, window, NULL);
npLabel = EzCreateLabel(L"Nic nie jest odtwarzane", 0, 475, 400, 30, window, TRUE);
playButton = EzCreateButton(L"Odtwarzaj", 75, 515, 100, 30, window, NULL);
pauseButton = EzCreateButton(L"Zatrzymaj", 195, 515, 100, 30, window, NULL);
autoPlayCheck = EzCreateButton(L"Odtwarzaj automatycznie", 80, 475, 200, 30, window, WS_CHILD | BS_CHECKBOX);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch (msg) {