Widget

The way this module works is it builds on top of a SimpleWindow from simpledisplay to provide simple controls and such.

Non-native controls suck, but nevertheless, I'm going to do it that way to avoid dependencies on stuff like gtk on X... and since I'll be writing the widgets there, I might as well just use them on Windows too if you like, using -version=custom_widgets.

So, by extension, this sucks. But gtkd is just too big for me.

More...
class Widget {
string statusTip;
bool tabStop;
int tabOrder;
Widget[HWND] nativeMapping;
HWND hwnd;
WNDPROC originalWindowProcedure;
bool implicitlyCreated;
int x;
int y;
int width;
int height;
Widget[] children;
Widget parent;
Window parentWindow;
auto re;
SimpleWindow drawableWindow;
}

Constructors

this
this(Widget parent = null)

Members

Functions

addDirectEventListener
EventListener addDirectEventListener(string event, void delegate() handler, bool useCapture = false)

Events use a Javascript-esque scheme.

addDirectEventListener
EventListener addDirectEventListener(string event, void delegate(Event) handler, bool useCapture = false)
addEventListener
EventListener addEventListener(string event, void delegate() handler, bool useCapture = false)
addEventListener
EventListener addEventListener(string event, void delegate(Event) handler, bool useCapture = false)
addEventListener
EventListener addEventListener(string event, EventHandler handler, bool useCapture = false)
backgroundColor
void backgroundColor(Color c)
backgroundColor
Color backgroundColor()
defaultEventHandler_blur
void defaultEventHandler_blur(Event event)
defaultEventHandler_change
void defaultEventHandler_change(Event event)
defaultEventHandler_char
void defaultEventHandler_char(Event event)
defaultEventHandler_click
void defaultEventHandler_click(Event event)
defaultEventHandler_focus
void defaultEventHandler_focus(Event event)
defaultEventHandler_keydown
void defaultEventHandler_keydown(Event event)
defaultEventHandler_keyup
void defaultEventHandler_keyup(Event event)
defaultEventHandler_mousedown
void defaultEventHandler_mousedown(Event event)
defaultEventHandler_mouseenter
void defaultEventHandler_mouseenter(Event event)
defaultEventHandler_mouseleave
void defaultEventHandler_mouseleave(Event event)
defaultEventHandler_mousemove
void defaultEventHandler_mousemove(Event event)
defaultEventHandler_mouseout
void defaultEventHandler_mouseout(Event event)
defaultEventHandler_mouseover
void defaultEventHandler_mouseover(Event event)
defaultEventHandler_mouseup
void defaultEventHandler_mouseup(Event event)
defaultEventHandler_triggered
void defaultEventHandler_triggered(Event event)

Default event handlers. These are called on the appropriate event unless Event.preventDefault is called on the event at some point through the bubbling process.

draw
ScreenPainter draw()
erase
void erase(ScreenPainter painter)

I don't actually like the name of this this draws a background on it

focus
void focus()
getByName
WidgetClass getByName(string name)
globalCoordinates
Point globalCoordinates()
hide
void hide()
isFocused
bool isFocused()
paint
void paint(ScreenPainter painter)
redraw
void redraw(string file = __FILE__, size_t line = __LINE__)
removeEventListener
void removeEventListener(string event, EventHandler handler, bool useCapture = false)
removeEventListener
void removeEventListener(EventListener listener)
removeWidget
void removeWidget()
setupDefaultEventHandlers
void setupDefaultEventHandlers()

Default event handlers. These are called on the appropriate event unless Event.preventDefault is called on the event at some point through the bubbling process.

show
void show()

Variables

defaultEventHandlers
EventHandler[string] defaultEventHandlers;

Default event handlers. These are called on the appropriate event unless Event.preventDefault is called on the event at some point through the bubbling process.

name
string name;

Detailed Description

The goal is to look kinda like Windows 95, perhaps with customizability. Nothing too fancy, just the basics that work.

Suggestion Box / Bug Report