-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Jayveer/feature/native-gui
Feature/native gui
- Loading branch information
Showing
16 changed files
with
114 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "ProgressComponent.h" | ||
|
||
ProgressComponent::ProgressComponent() { | ||
|
||
} | ||
|
||
ProgressComponent::~ProgressComponent() { | ||
|
||
} | ||
|
||
void ProgressComponent::create(HWND parent, Dimensions dimensions, Origin origin) { | ||
DWORD style = WS_CHILD | WS_VISIBLE; | ||
HWND hwnd = CreateWindow(PROGRESS_CLASS, "Loading file", style, origin.x, origin.y, dimensions.width, dimensions.height, parent, NULL, NULL, this); | ||
setHandle(hwnd); | ||
} | ||
|
||
void ProgressComponent::setRange(int maxRange) { | ||
SendMessage(getHandle(), PBM_SETRANGE, 0, MAKELPARAM(0, maxRange)); | ||
} | ||
|
||
void ProgressComponent::setIncrement() { | ||
SendMessage(getHandle(), PBM_SETSTEP, (WPARAM)1, 0); | ||
} | ||
|
||
void ProgressComponent::increment() { | ||
SendMessage(getHandle(), PBM_STEPIT, 0, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include "../Component.h" | ||
|
||
class ProgressComponent : Component { | ||
public: | ||
ProgressComponent(); | ||
~ProgressComponent(); | ||
|
||
void create(HWND parent, Dimensions dimensions, Origin origin); | ||
void setRange(int maxRange); | ||
void setIncrement(); | ||
void increment(); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
#pragma once | ||
#include <string> | ||
#include <math.h> | ||
|
||
inline | ||
int byteToKiloByte(int bytes) { | ||
return bytes % 1024 ? (bytes / 1024) + 1 : bytes / 1024; | ||
} |