ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
ATTRIB(Dialog, backgroundImage, string, string_null)
+ ATTRIB(Dialog, borderLines, float, 1)
ATTRIB(Dialog, closeButtonImage, string, string_null)
ATTRIB(Dialog, frame, entity, NULL)
void Dialog_addItemSimple(entity me, float row, float col, float rowspan, float colspan, entity e, vector v)
{
- //print(vtos(me.itemSpacing), " ", vtos(me.itemSize), "\n");
vector o, s;
o = me.itemOrigin + eX * ( col * me.itemSpacing_x) + eY * ( row * me.itemSpacing_y);
s = me.itemSize + eX * ((colspan - 1) * me.itemSpacing_x) + eY * ((rowspan - 1) * me.itemSpacing_y);
void Dialog_configureDialog(entity me)
{
- entity closebutton;
float absWidth, absHeight;
me.frame = spawnBorderImage();
- me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.titleHeight);
+ me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
me.frame.alpha = me.alpha;
me.titleHeight = 0; // no title bar
absWidth = me.intendedWidth * conwidth;
- absHeight = me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
+ absHeight = me.borderLines * me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
me.itemOrigin = eX * (me.marginLeft / absWidth)
- + eY * ((me.titleHeight + me.marginTop) / absHeight);
+ + eY * ((me.borderLines * me.titleHeight + me.marginTop) / absHeight);
me.itemSize = eX * ((1 - (me.marginLeft + me.marginRight + me.columnSpacing * (me.columns - 1)) / absWidth) / me.columns)
+ eY * (me.rowHeight / absHeight);
me.itemSpacing = me.itemSize
me.fill(me);
- if(me.closable)
+ if(me.closable && me.borderLines > 0)
{
- closebutton = me.closeButton = spawnButton();
- closebutton.configureButton(closebutton, "Close", 0, me.closeButtonImage);
+ entity closebutton;
+ closebutton = me.closeButton = me.frame.closeButton = spawnButton();
+ closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
closebutton.srcMulti = 0;
me.addItem(me, closebutton, '0 0 0', '1 1 0', 1); // put it as LAST
}
-
- me.frame.closeButton = closebutton;
}
void Dialog_close(entity me)