import "i18n"
// Had to define this here for native decorations support, because the menu bar is part of total decoration's size, but not part of the system decorations
+#ifdef HIGH_DPI
+define skinMenuHeight = 40;
+define statusBarHeight = 30;
+#else
define skinMenuHeight = 25;
define statusBarHeight = 18;
+#endif
default extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown;
-public enum DialogResult { cancel, yes, no, ok };
+public enum DialogResult : int64 { cancel, yes, no, ok };
public class MouseButtons
{
Window()
{
- if(guiApp) guiApp.Initialize(true);
+ bool switchMode = true;
+#if defined(__ANDROID__)
+ switchMode = false;
+ fullRender = true;
+#endif
+ if(guiApp)
+ guiApp.Initialize(switchMode);
if(guiApp && guiApp.currentSkin && ((subclass(Window))_class).pureVTbl)
{
{
int x = absPosition.x + clientStart.x;
int y = absPosition.y + clientStart.y;
- if(rootWindow.nativeDecorations)
+ if(rootWindow.nativeDecorations && rootWindow.windowHandle)
{
x -= rootWindow.clientStart.x;
y -= rootWindow.clientStart.y - (rootWindow.hasMenuBar ? skinMenuHeight : 0);
{
int x = absPosition.x;
int y = absPosition.y;
- if(rootWindow.nativeDecorations)
+ if(rootWindow.nativeDecorations && rootWindow.windowHandle)
{
x -= rootWindow.clientStart.x;
y -= rootWindow.clientStart.y - (rootWindow.hasMenuBar ? skinMenuHeight : 0);
}
// This is required to get proper initial decoration size using native decorations on Windows
- if(nativeDecorations && guiApp && guiApp.interfaceDriver && !visible)
+ if(nativeDecorations && windowHandle && guiApp && guiApp.interfaceDriver && !visible)
guiApp.interfaceDriver.PositionRootWindow(this, x, y, Max(1, size.w), Max(1, size.h), true, true);
GetDecorationsSize(&ew, &eh);
SetPosition(x, y, w, h, true, modifyArea, updateScrollBars);
clientResized = oldCW != clientSize.w || oldCH != clientSize.h || force;
- if(clientResized && this == rootWindow && nativeDecorations)
+ if(clientResized && this == rootWindow && nativeDecorations && rootWindow.windowHandle)
windowResized = true;
if(display && rootWindow != this)
y -= guiApp.desktop.absPosition.y;
}*/
//guiApp.Log("Position %s\n", caption);
- if(windowResized || windowMoved)
- if(display && !display.flags.memBackBuffer && changeRootWindow)
- guiApp.interfaceDriver.PositionRootWindow(this, x, y, w, h, windowMoved, windowResized); //realResized);
+ if(windowHandle)
+ {
+ if(windowResized || windowMoved)
+ if(display && !display.flags.memBackBuffer && changeRootWindow)
+ guiApp.interfaceDriver.PositionRootWindow(this, x, y, w, h, windowMoved, windowResized); //realResized);
- if(!guiApp.fullScreenMode && this != guiApp.desktop && (windowResized || windowMoved))
- for(child = parent.children.first; child && child != this; child = child.next)
- if(child.rootWindow)
- guiApp.interfaceDriver.UpdateRootWindow(child.rootWindow);
+ if(!guiApp.fullScreenMode && this != guiApp.desktop && (windowResized || windowMoved))
+ for(child = parent.children.first; child && child != this; child = child.next)
+ if(child.rootWindow)
+ guiApp.interfaceDriver.UpdateRootWindow(child.rootWindow);
+ }
if(display)
{
if(windowResized)
{
// result = realResized ? display.Resize(size.w, size.h) : true;
- if(nativeDecorations)
+ if(nativeDecorations && rootWindow.windowHandle)
{
int w = clientSize.w, h = clientSize.h;
if(hasMenuBar) h += skinMenuHeight;
display.Unlock();
}
}
- if(guiApp.driver && changeRootWindow)
+ if(guiApp.driver && changeRootWindow && windowHandle)
{
if(windowResized || windowMoved)
if(!display || display.flags.memBackBuffer)
}
else
{
+ int oldHRange = sbh ? sbh.range : 0;
+ int oldVRange = sbv ? sbv.range : 0;
// Then start off with horizontal scrollbar range
if(sbh)
{
positionH = sbh.thumbPosition;
+
+ /*
sbh.seen = cw;
sbh.total = rvw;
+ */
+ SBSetSeen(sbh, cw);
+ SBSetTotal(sbh, rvw);
rangeH = sbh.range;
if(rangeH > 1)
ch -= guiApp.currentSkin.HorizontalSBH();
if(sbv)
{
positionV = sbv.thumbPosition;
+ /*
sbv.seen = ch;
sbv.total = rvh;
+ */
+ SBSetSeen(sbv, ch);
+ SBSetTotal(sbv, rvh);
rangeV = sbv.range;
if(rangeV > 1)
{
// Maybe we need to set the range on the horizontal scrollbar again
if(sbh)
{
+ /*
sbh.seen = cw;
sbh.total = rvw;
- sbh.Action(setRange, positionH, 0);
+ */
+ SBSetSeen(sbh, cw);
+ SBSetTotal(sbh, rvw);
+ //sbh.Action(setRange, positionH, 0);
if(rangeH <= 1 && sbh.range > 1)
{
ch -= guiApp.currentSkin.HorizontalSBH();
+ /*
sbv.seen = ch;
sbv.total = rvh;
+ */
+ SBSetSeen(sbv, ch);
+ SBSetTotal(sbv, rvh);
rangeV = sbv.range;
- sbv.Action(setRange, positionV, 0);
+ //sbv.Action(setRange, positionV, 0);
}
rangeH = sbh.range;
}
}
+ if(sbh && sbh.range != oldHRange) sbh.Action(setRange, positionH, 0);
+ if(sbv && sbv.range != oldVRange) sbv.Action(setRange, positionV, 0);
}
// Update the scrollbar visibility
if(sbh) // && !sbh.style.hidden
{
- sbh.Move(clientStart.x, clientStart.y + clientSize.h, clientSize.w,0);
+ if(!sbh.anchored)
+ sbh.Move(clientStart.x, clientStart.y + clientSize.h, clientSize.w,0);
// Need to set the range again (should improve...) since the scrollbars didn't have
// the right size when UpdateScrollArea set the range on it
if(flag)
}
if(sbv) // && !sbv.state.hidden
{
- sbv.Move(clientStart.x + clientSize.w, clientStart.y, 0, clientSize.h);
+ if(!sbv.anchored)
+ sbv.Move(clientStart.x + clientSize.w, clientStart.y, 0, clientSize.h);
// Need to set the range again (should improve...) since the scrollbars didn't have
// the right size when UpdateScrollArea set the range on it
if(flag)
Window GetParentMenuBar()
{
+ Window result = this;
+ bool notActiveClient = false;
Window menuBarParent;
for(menuBarParent = this; menuBarParent; menuBarParent = menuBarParent.parent)
{
- if(menuBarParent.menuBar) break;
+ if(menuBarParent.menuBar) { result = notActiveClient ? null : menuBarParent.menuBar; break; }
if(menuBarParent.parent && /*menuBarParent != */!menuBarParent.parent.activeClient)
- {
- menuBarParent = null;
- break;
- }
+ notActiveClient = true;
}
- return menuBarParent ? menuBarParent.menuBar : null;
+ return result;
}
void CreateSystemChildren(void)
UpdateDecorations();
if(parent)
{
- if(parent.rootWindow == parent && parent.activeClient == this) // Added this last check
+ if(parent.activeClient == this) // Added this last check
{
- char caption[2048];
- parent.FigureCaption(caption);
- guiApp.interfaceDriver.SetRootWindowCaption(parent, caption);
+ if(parent.rootWindow == parent)
+ {
+ char caption[2048];
+ parent.FigureCaption(caption);
+ guiApp.interfaceDriver.SetRootWindowCaption(parent, caption);
+ }
+ else
+ parent.UpdateCaption();
}
parent.UpdateDecorations();
}
bool opaque = IsOpaque();
Window child;
int offsetX = absPosition.x - rootWindow.absPosition.x, offsetY = absPosition.y - rootWindow.absPosition.y;
- if(rootWindow.nativeDecorations)
+ if(rootWindow.nativeDecorations && rootWindow.windowHandle)
{
offsetX -= rootWindow.clientStart.x;
offsetY -= rootWindow.clientStart.y - (rootWindow.hasMenuBar ? skinMenuHeight : 0);
Extent * renderArea = &rootWindow.tempExtents[1];
int offsetX = child.absPosition.x - rootWindow.absPosition.x, offsetY = child.absPosition.y - rootWindow.absPosition.y;
- if(child.rootWindow.nativeDecorations)
+ if(child.rootWindow.nativeDecorations && rootWindow.windowHandle)
{
offsetX -= child.rootWindow.clientStart.x;
offsetY -= child.rootWindow.clientStart.y - (child.rootWindow.hasMenuBar ? skinMenuHeight : 0);
Extent * dirtyExtentWindow = &rootWindow.tempExtents[1];
Window child;
int offsetX = absPosition.x - rootWindow.absPosition.x, offsetY = absPosition.y - rootWindow.absPosition.y;
- if(rootWindow.nativeDecorations)
+ if(rootWindow.nativeDecorations && rootWindow.windowHandle)
{
offsetX -= rootWindow.clientStart.x;
offsetY -= rootWindow.clientStart.y - (rootWindow.hasMenuBar ? skinMenuHeight : 0);
Window child;
Window rootWindow = this.rootWindow;
int offsetX = absPosition.x - rootWindow.absPosition.x, offsetY = absPosition.y - rootWindow.absPosition.y;
- if(rootWindow.nativeDecorations)
+ if(rootWindow.nativeDecorations && rootWindow.windowHandle)
{
offsetX -= rootWindow.clientStart.x;
offsetY -= rootWindow.clientStart.y - (rootWindow.hasMenuBar ? skinMenuHeight : 0);
bool real = parent.activeChild != this;
// TEST THIS: New activateParent check here!!! CAUSED MENUS NOT GOING AWAY
- if(/*activateParent && */guiApp.interimWindow &&
+ if(!style.inactive && /*activateParent && */guiApp.interimWindow &&
!IsDescendantOf(guiApp.interimWindow) &&
!IsSlaveOf(guiApp.interimWindow))
{
case tab: case shiftTab:
{
Window cycleParent = this;
- if(this == guiApp.interimWindow && !master.style.interim && !cycleParent.style.tabCycle)
+ if(this == guiApp.interimWindow && master && !master.style.interim && !cycleParent.style.tabCycle && master.parent)
cycleParent = master.parent;
if(!guiApp.windowCaptured && cycleParent.style.tabCycle)
Window hotKeyWindow = hotKey.window;
Window parent = hotKeyWindow.parent;
Window prevActiveWindow = activeChild;
+ // For when sys buttons are placed inside the menu bar
+ if(parent && parent._class == class(PopupMenu))
+ parent = parent.parent;
- // Don't process non-visible buttons, but make an exception for the Alt-F4 with Native Decorations turned on
- if(hotKeyWindow.style.hidden && (!hotKeyWindow.style.nonClient || !parent || !parent.nativeDecorations || (hotKeyWindow != parent.sysButtons[2] && hotKeyWindow != parent.sysButtons[1] )))
+ // Don't process non-visible buttons, but make an exception for the Alt-F4 with Native Decorations turned on; This handles alt+enter as well
+ if(hotKeyWindow.style.hidden && (!hotKeyWindow.style.nonClient || !parent || !parent.nativeDecorations || (hotKeyWindow != parent.sysButtons[2] && hotKeyWindow != parent.sysButtons[1])))
continue;
if(prevActiveWindow) incref prevActiveWindow;
// Setup relationship with outside world (bb root || !bb)
if((!guiApp.fullScreenMode && parent == guiApp.desktop) || this == guiApp.desktop ||
- (_displayDriver && dispDriver != parent.dispDriver))
+ (_displayDriver && parent.dispDriver && dispDriver != parent.dispDriver))
{
rootWindow = this;
if(!tempExtents)
bool result = false;
Window child;
- if((!guiApp.fullScreenMode && parent == guiApp.desktop) || (guiApp.fullScreenMode && (this == guiApp.desktop || (_displayDriver && dispDriver != parent.dispDriver))))
+ if((!guiApp.fullScreenMode && parent == guiApp.desktop) || (guiApp.fullScreenMode && (this == guiApp.desktop || (_displayDriver && parent.dispDriver && dispDriver != parent.dispDriver))))
{
subclass(DisplayDriver) dDriver = (dispDriver && !formDesigner) ? dispDriver : GetDisplayDriver(guiApp.defaultDisplayDriver);
DisplaySystem displaySystem = dDriver ? dDriver.displaySystem : null;
delete display;
}
}
- guiApp.interfaceDriver.SetIcon(this, icon);
+ // Sometimes icon does not show up on Windows XP if we set here...
+ // guiApp.interfaceDriver.SetIcon(this, icon);
}
else if(this != guiApp.desktop)
{
Window child;
WindowState stateBackup = state;
- /*
- if(!rootWindow.created)
- printf("");
- */
-
if(((subclass(Window))_class).pureVTbl)
{
if(_vTbl == _class._vTbl)
}
*/
- captionFont = guiApp.currentSkin.CaptionFont();
+ captionFont = guiApp.currentSkin ? guiApp.currentSkin.CaptionFont() : null;
AddResource(captionFont);
if(OnLoadGraphics())
return result;
}
- bool DestroyEx(int returnCode)
+ bool DestroyEx(int64 returnCode)
{
OldLink slave;
Timer timer, nextTimer;
if(master.defaultControl == this)
master.defaultControl = null;
}
+ if(parent)
+ parent.OnChildAddedOrRemoved(this, true);
if(parent && !parent.destroyed /*&&
rootWindow && rootWindow.display && !rootWindow.destroyed*/)
{
if(prevState != newState)
lastState = prevState;
- if(rootWindow != this || !nativeDecorations)
+ if(rootWindow != this || !nativeDecorations || !windowHandle)
{
if(style.isActiveClient && !style.hidden && prevState == minimized)
parent.numIcons--;
if(child.cycle && !child.style.nonClient && child.style.isActiveClient && child.visible)
{
DataRow row = listBox.AddRow();
- row.tag = (int)child;
+ row.tag = (int64)child;
child.FigureCaption(caption);
row.SetData(null, caption);
}
(master && master != guiApp.desktop && !master.created))
return false;
+ if(parent)
+ stopwatching(parent, font);
+
if(!parent)
property::parent = guiApp.desktop;
if(!master) master = parent;
Window slave = link.data;
next = link.next;
if(!slave.created && (slave.autoCreate || slave.wasCreated))
- slave.Create();
+ {
+ if(slave.Create())
+ // Things might have happened that invalidated 'next'...
+ // Start over the search for slaves to create.
+ // (Added this to fix crash with Stacker & Toolbar)
+ next = slaves.first;
+ }
}
}
if(state == minimized) parent.numIcons--;
}
+ parent.OnChildAddedOrRemoved(this, false);
+
// Real set state & activate for proper display & activation
property::visible = visible;
// SetState(state & 0x00000003, true, 0);
+ guiApp.interfaceDriver.SetIcon(this, icon);
if(visible)
{
return result;
}
- bool Destroy(int code)
+ bool Destroy(int64 code)
{
//if(created)
if(this)
char caption[MAX_F_STRING];
va_list args;
va_start(args, format);
- vsprintf(caption, format, args);
+ vsnprintf(caption, sizeof(caption), format, args);
+ caption[sizeof(caption)-1] = 0;
va_end(args);
- this.caption = new char[strlen(caption)+1];
- if(this.caption)
- strcpy(this.caption, caption);
+ this.caption = CopyString(caption);
}
if(created)
UpdateCaption();
else
sprintf(message, $"Save changes to Untitled %d?", documentID);
- dialogRes = MessageBox { master = master, type = yesNoCancel, text = parent.caption, contents = message }.Modal();
+ dialogRes = MessageBox { master = master, type = yesNoCancel, text = parent.caption ? parent.caption : rootWindow.caption, contents = message }.Modal();
if(dialogRes == yes)
{
if(result)
{
for(slave = slaves.first; slave; slave = slave.next)
- if(!((Window)slave.data).CloseConfirmation(true))
+ {
+ Window w = slave.data;
+ if((w.parent == this || !w.IsDescendantOf(this)) && !w.CloseConfirmation(true))
{
// ((Window)slave.data).CloseConfirmation(true);
result = false;
break;
}
+ }
}
if(result)
bool MenuWindowSelectWindow(MenuItem selection, Modifiers mods)
{
Window document;
- int id = selection.id;
+ int64 id = selection.id;
OldLink cycle = activeClient.cycle;
int c = 0;
//for(c = 0, cycle = activeChild.cycle; c<id; cycle = cycle.next, c++);
}
virtual void ShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving);
virtual void PreShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving);
- virtual bool IsMouseMoving(int x, int y, int w, int h);
- virtual bool IsMouseResizing(int x, int y, int w, int h, bool *resizeX, bool *resizeY, bool *resizeEndX, bool *resizeEndY);
+ virtual bool IsMouseMoving(int x, int y, int w, int h)
+ {
+ return false;
+ }
+ virtual bool IsMouseResizing(int x, int y, int w, int h, bool *resizeX, bool *resizeY, bool *resizeEndX, bool *resizeEndY)
+ {
+ return false;
+ }
virtual void UpdateNonClient();
virtual void SetBox(Box box);
virtual bool IsInside(int x, int y)
if(parent)
{
parent.children.Remove(this);
- parent.OnChildAddedOrRemoved(this, true);
parent.Update(
{
parent.childrenOrder.Delete(order);
cycle = null;
order = null;
+ // *** TODO: Added this here to solve crash on setting parent to null before destroying/destructing ***
+ // Should something else be done?
+ if(parent && parent.activeChild == this)
+ parent.activeChild = null;
+ if(parent && parent.activeClient == this)
+ parent.activeClient = null;
//if(created)
{
*/
}
scrolledPos.x = MININT; // Prevent parent update
- property::anchor = anchor;
+ {
+ bool anchored = this.anchored;
+ property::anchor = anchor;
+ this.anchored = anchored;
+ }
/*
{
int x, y, w, h;
}
// else parent = value;
+ if(oldParent)
+ oldParent.OnChildAddedOrRemoved(this, true);
}
}
get { return parent; }
set
{
background.a = (byte)Min(Max((int)(value * 255), 0), 255);
- drawBehind = background.a ? false : true;
+ drawBehind = (background.a == 255) ? false : true;
}
get { return background.a / 255.0f; }
};
property Point scroll
{
property_category $"Behavior"
- set
- {
- // scroll = value;
- // TESTING THIS IMPLEMENTATION:
- SetScrollPosition(value.x, value.y);
- }
+ set { SetScrollPosition(value.x, value.y); }
get { value = scroll; }
};
get { return (bool)modifyVirtArea; }
};
+ property bool dontAutoScrollArea
+ {
+ property_category $"Behavior"
+ // Activating a child control out of view will automatically scroll to make it in view
+ set { noAutoScrollArea = value; }
+ get { return (bool)noAutoScrollArea; }
+ };
+
property char * fileName
{
property_category $"Document"
get { return fileName; }
};
- property int id
+ property int64 id
{
property_category $"Data"
set { id = value; }
{
get { return (bool)nativeDecorations; }
set { nativeDecorations = value; }
-#ifndef ECERE_VANILLA
- isset { return (nativeDecorations && (rootWindow == this || (formDesigner && activeDesigner && parent == ((FormDesigner)activeDesigner.classDesigner).form.parent))) != style.fixed; }
+#if !defined(ECERE_VANILLA) && !defined(ECERE_NOTRUETYPE)
+ isset
+ {
+ //return (nativeDecorations && (rootWindow == this || (formDesigner && activeDesigner && ((FormDesigner)activeDesigner.classDesigner).form && parent == ((FormDesigner)activeDesigner.classDesigner).form.parent))) != style.fixed;
+ bool result = false;
+ if(nativeDecorations)
+ {
+ if(rootWindow == this)
+ result = true;
+ else
+ {
+ if(formDesigner && activeDesigner)
+ {
+ FormDesigner cd = (FormDesigner)activeDesigner.classDesigner;
+ Window form = cd ? cd.form : null;
+ if(form && parent == form.parent)
+ result = true;
+ }
+ }
+ }
+ return result != style.fixed;
+ }
#endif
};
property bool manageDisplay { get { return (bool)manageDisplay; } set { manageDisplay = value; } };
int numPositions;
Menu menu;
ScrollFlags scrollFlags;// Window Scrollbar Flags
- int id; // Control ID
+ int64 id; // Control ID
int documentID;
ColorAlpha background; // Background color used to draw the window area
Color foreground;
{
bool OnKeyDown(Key key, unichar ch)
{
- bool result = ((int(*)())(void *)controller.OnKeyDown)((void *)controller.controlled, (void *)controller, key, ch);
+ bool result = ((bool(*)(Window, WindowController, Key, unichar))(void *)controller.OnKeyDown)((Window)controller.controlled, controller, key, ch);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown](controller.window, key, ch);
+ result = ((bool (*)(Window, Key, unichar))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown])(controller.window, key, ch);
return result;
}
bool OnKeyUp(Key key, unichar ch)
{
- bool result = ((int(*)())(void *)controller.OnKeyUp)((void *)controller.controlled, (void *)controller, key, ch);
+ bool result = ((bool(*)(Window, WindowController, Key, unichar))(void *)controller.OnKeyUp)((Window)controller.controlled, controller, key, ch);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp](controller.window, key, ch);
+ result = ((bool(*)(Window, Key, unichar))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp])(controller.window, key, ch);
return result;
}
bool OnKeyHit(Key key, unichar ch)
{
- bool result = ((int(*)())(void *)controller.OnKeyHit)((void *)controller.controlled, (void *)controller, key, ch);
+ bool result = ((bool(*)(Window, WindowController, Key, unichar))(void *)controller.OnKeyHit)((Window)controller.controlled, controller, key, ch);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit](controller.window, key, ch);
+ result = ((bool(*)(Window, Key, unichar))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit])(controller.window, key, ch);
return result;
}
bool OnMouseMove(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnMouseMove)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnMouseMove)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMouseMove](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMouseMove])(controller.window, x, y, mods);
return result;
}
bool OnLeftButtonDown(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnLeftButtonDown)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnLeftButtonDown)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown])(controller.window, x, y, mods);
return result;
}
bool OnLeftButtonUp(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnLeftButtonUp)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnLeftButtonUp)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp])(controller.window, x, y, mods);
return result;
}
bool OnLeftDoubleClick(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnLeftDoubleClick)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnLeftDoubleClick)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick])(controller.window, x, y, mods);
return result;
}
bool OnRightButtonDown(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnRightButtonDown)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnRightButtonDown)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown])(controller.window, x, y, mods);
return result;
}
bool OnRightButtonUp(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnRightButtonUp)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnRightButtonUp)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonUp](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonUp])(controller.window, x, y, mods);
return result;
}
bool OnRightDoubleClick(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnRightDoubleClick)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnRightDoubleClick)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightDoubleClick](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightDoubleClick])(controller.window, x, y, mods);
return result;
}
bool OnMiddleButtonDown(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnMiddleButtonDown)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnMiddleButtonDown)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown])(controller.window, x, y, mods);
return result;
}
bool OnMiddleButtonUp(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnMiddleButtonUp)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnMiddleButtonUp)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonUp](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonUp])(controller.window, x, y, mods);
return result;
}
bool OnMiddleDoubleClick(int x, int y, Modifiers mods)
{
- bool result = ((int(*)())(void *)controller.OnMiddleDoubleClick)((void *)controller.controlled, (void *)controller, x, y, mods);
+ bool result = ((bool(*)(Window, WindowController, int, int, Modifiers))(void *)controller.OnMiddleDoubleClick)((Window)controller.controlled, controller, x, y, mods);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleDoubleClick](controller.window, x, y, mods);
+ result = ((bool(*)(Window, int, int, Modifiers))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleDoubleClick])(controller.window, x, y, mods);
return result;
}
void OnResize(int width, int height)
{
- ((int(*)())(void *)controller.OnResize)((void *)controller.controlled, (void *)controller, width, height);
- controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnResize](controller.window, width, height);
+ ((void(*)(Window, WindowController, int, int))(void *)controller.OnResize)((Window)controller.controlled, controller, width, height);
+ ((void(*)(Window, int, int))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnResize])(controller.window, width, height);
}
void OnRedraw(Surface surface)
{
- ((int(*)())(void *)controller.OnRedraw)((void *)controller.controlled, (void *)controller, surface);
- controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRedraw](controller.window, surface);
+ ((void(*)(Window, WindowController, Surface))(void *)controller.OnRedraw)((Window)controller.controlled, controller, surface);
+ ((void(*)(Window, Surface))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRedraw])(controller.window, surface);
}
bool OnCreate()
{
- bool result = ((int(*)())(void *)controller.OnCreate)((void *)controller.controlled, (void *)controller);
+ bool result = ((bool(*)(Window, WindowController))(void *)controller.OnCreate)((Window)controller.controlled, controller);
if(result)
- result = controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnCreate](controller.window);
+ result = ((bool(*)(Window))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnCreate])(controller.window);
return result;
}
+
+ bool OnLoadGraphics()
+ {
+ bool result = ((bool(*)(Window, WindowController))(void *)controller.OnLoadGraphics)((Window)controller.controlled, controller);
+ if(result)
+ result = ((bool(*)(Window))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLoadGraphics])(controller.window);
+ return result;
+ }
+
+ void OnUnloadGraphics()
+ {
+ ((void(*)(Window, WindowController))(void *)controller.OnUnloadGraphics)((Window)controller.controlled, controller);
+ ((void(*)(Window))(void *)controller.windowVTbl[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnUnloadGraphics])(controller.window);
+ }
}
public class WindowController<class V>
virtual void V::OnResize(WindowController controller, int width, int height);
virtual void V::OnRedraw(WindowController controller, Surface surface);
virtual bool V::OnCreate(WindowController controller);
+ virtual bool V::OnLoadGraphics(WindowController controller);
+ virtual void V::OnUnloadGraphics(WindowController controller);
private:
int (** windowVTbl)();