-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a94786
commit 6d6d1d8
Showing
13 changed files
with
472 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Buttons - 3/10/23 | ||
- Fixed the error with the mouse being weird and not sending click events properly, Window was passing X,Y to the mouse instead of mouseX, mouseY. (X,Y are keycodes that were included with the keyboard driver) | ||
- Fixed button releasing error | ||
# Input Box - 20/10/23 | ||
- Added Input Boxes | ||
- Will need to fix focusing and stuff tho |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// Created by 98max on 11/10/2023. | ||
// | ||
|
||
#ifndef MAXOS_GUI_WIDGETS_INPUTBOX_H | ||
#define MAXOS_GUI_WIDGETS_INPUTBOX_H | ||
|
||
#include <common/types.h> | ||
#include <gui/widget.h> | ||
#include <gui/font.h> | ||
|
||
namespace maxOS{ | ||
|
||
namespace gui { | ||
|
||
namespace widgets { | ||
|
||
enum InputBoxEvents{ | ||
INPUTBOX_TEXT_CHANGED | ||
}; | ||
|
||
class InputBoxTextChangedEvent : public common::Event<InputBoxEvents>{ | ||
public: | ||
InputBoxTextChangedEvent(common::string newText); | ||
~InputBoxTextChangedEvent(); | ||
|
||
common::string newText; | ||
}; | ||
|
||
class InputBoxEventHandler : public common::EventHandler<InputBoxEvents>{ | ||
public: | ||
InputBoxEventHandler(); | ||
~InputBoxEventHandler(); | ||
|
||
virtual void onEvent(common::Event<InputBoxEvents>* event); | ||
|
||
virtual void onInputBoxTextChanged(common::string newText); | ||
}; | ||
|
||
class InputBox : public Widget, public common::EventManager<InputBoxEvents>{ | ||
|
||
protected: | ||
char widgetText[256]; // Replace with a buffer in memory later | ||
|
||
public: | ||
InputBox(common::int32_t left, common::int32_t top, common::uint32_t width, common::uint32_t height); | ||
InputBox(common::int32_t left, common::int32_t top, common::uint32_t width, common::uint32_t height, common::string text); | ||
~InputBox(); | ||
|
||
void draw(common::GraphicsContext* gc, common::Rectangle<int>& area); | ||
|
||
void onFocus(); | ||
void onFocusLost(); | ||
|
||
void onKeyDown(drivers::peripherals::KeyCode keyDownCode, drivers::peripherals::KeyboardState keyDownState); | ||
|
||
void updateText(common::string newText); | ||
common::string getText(); | ||
|
||
// InputBox Variables | ||
common::Colour backgroundColour; | ||
common::Colour foregroundColour; | ||
common::Colour borderColour; | ||
gui::AmigaFont font; | ||
common::uint32_t cursorPosition; | ||
|
||
}; | ||
} | ||
} | ||
} | ||
|
||
#endif //MAXOS_GUI_WIDGETS_INPUTBOX_H |
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
Oops, something went wrong.