Laid out the interface for user window drags.
This commit is contained in:
parent
1871f7139d
commit
67ff2fa855
|
@ -101,41 +101,18 @@ static void handlerMouseEvent(uiAreaHandler *a, uiArea *area, uiAreaMouseEvent *
|
|||
if (e->Down != 1)
|
||||
return;
|
||||
if (ta.move.in || ta.alsomove.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.leftresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.topresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.rightresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.bottomresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.topleftresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.toprightresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.bottomleftresize.in) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
if (ta.bottomrightresize.in) {
|
||||
// TODO
|
||||
uiAreaBeginUserWindowMove(area);
|
||||
return;
|
||||
}
|
||||
#define resize(cond, edge) if (cond) { uiAreaBeginUserWindowResize(area, edge); return; }
|
||||
resize(ta.leftresize.in, uiWindowResizeEdgeLeft)
|
||||
resize(ta.topresize.in, uiWindowResizeEdgeTop)
|
||||
resize((ta.rightresize.in, uiWindowResizeEdgeRight)
|
||||
resize(ta.bottomresize.in, uiWindowResizeEdgeBottom)
|
||||
resize(ta.topleftresize.in, uiWindowResizeEdgeTopLeft)
|
||||
resize(ta.toprightresize.in, uiWindowResizeEdgeTopRight)
|
||||
resize(ta.bottomleftresize.in, uiWindowResizeEdgeBottomLeft)
|
||||
resize(ta.bottomrightresize.in, uiWindowResizeEdgeBottomRight)
|
||||
if (ta.close.in) {
|
||||
// TODO
|
||||
return;
|
||||
|
|
18
ui.h
18
ui.h
|
@ -289,6 +289,20 @@ struct uiAreaHandler {
|
|||
int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *);
|
||||
};
|
||||
|
||||
// TODO RTL layouts?
|
||||
// TODO reconcile edge and corner naming
|
||||
_UI_ENUM(uiWindowResizeEdge) {
|
||||
uiWindowResizeEdgeLeft,
|
||||
uiWindowResizeEdgeTop,
|
||||
uiWindowResizeEdgeRight,
|
||||
uiWindowResizeEdgeBottom,
|
||||
uiWindowResizeEdgeTopLeft,
|
||||
uiWindowResizeEdgeTopRight,
|
||||
uiWindowResizeEdgeBottomLeft,
|
||||
uiWindowResizeEdgeBottomRight,
|
||||
// TODO have one for keyboard resizes?
|
||||
};
|
||||
|
||||
#define uiArea(this) ((uiArea *) (this))
|
||||
// TODO give a better name
|
||||
// TODO document the types of width and height
|
||||
|
@ -296,6 +310,10 @@ _UI_EXTERN void uiAreaSetSize(uiArea *a, int width, int height);
|
|||
// TODO uiAreaQueueRedraw()
|
||||
_UI_EXTERN void uiAreaQueueRedrawAll(uiArea *a);
|
||||
_UI_EXTERN void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height);
|
||||
// TODO document these can only be called within Mouse() handlers
|
||||
// TODO should these be allowed on scrolling areas?
|
||||
_UI_EXTERN void uiAreaBeginUserWindowMove(uiArea *a);
|
||||
_UI_EXTERN void uiAreaBeginUserWindowResize(uiArea *a, uiWindowResizeEdge edge);
|
||||
_UI_EXTERN uiArea *uiNewArea(uiAreaHandler *ah);
|
||||
_UI_EXTERN uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height);
|
||||
|
||||
|
|
Loading…
Reference in New Issue