This commit is contained in:
parent
37c3f9cbdc
commit
d1143a68ac
1 changed files with 13 additions and 16 deletions
|
|
@ -152,14 +152,8 @@ static void show_frame(MwWidget handle) {
|
||||||
int n = MwGetInteger(handle, MwNvalue);
|
int n = MwGetInteger(handle, MwNvalue);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < arrlen(t->frames); i++) {
|
|
||||||
if(i != n) MwLLShow(t->frames[i]->lowlevel, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
resize(handle);
|
resize(handle);
|
||||||
|
|
||||||
MwLLShow(t->frames[n]->lowlevel, 1);
|
|
||||||
|
|
||||||
MwForceRender(handle);
|
MwForceRender(handle);
|
||||||
|
|
||||||
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
|
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
|
||||||
|
|
@ -185,14 +179,12 @@ static void click(MwWidget handle) {
|
||||||
|
|
||||||
static MwWidget mwTabAddImpl(MwWidget handle, const char* name) {
|
static MwWidget mwTabAddImpl(MwWidget handle, const char* name) {
|
||||||
MwTab t = handle->internal;
|
MwTab t = handle->internal;
|
||||||
MwWidget f = MwCreateWidget(MwFrameClass, "tabframe", handle, 0, MwGetInteger(handle, MwNheight), 0, 0);
|
MwWidget f = MwCreateWidget(MwFrameClass, "tabframe", handle, 0, MwGetInteger(handle, MwNheight), MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2);
|
||||||
char* n = MwStringDuplicate(name);
|
char* n = MwStringDuplicate(name);
|
||||||
|
|
||||||
arrput(t->frames, f);
|
arrput(t->frames, f);
|
||||||
arrput(t->names, n);
|
arrput(t->names, n);
|
||||||
|
|
||||||
MwLLShow(f->lowlevel, 0);
|
|
||||||
|
|
||||||
MwForceRender(handle);
|
MwForceRender(handle);
|
||||||
|
|
||||||
if(MwGetInteger(handle, MwNvalue) == -1) {
|
if(MwGetInteger(handle, MwNvalue) == -1) {
|
||||||
|
|
@ -229,15 +221,20 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
|
||||||
static void resize(MwWidget handle) {
|
static void resize(MwWidget handle) {
|
||||||
MwTab t = handle->internal;
|
MwTab t = handle->internal;
|
||||||
int v = MwGetInteger(handle, MwNvalue);
|
int v = MwGetInteger(handle, MwNvalue);
|
||||||
|
int i;
|
||||||
|
|
||||||
if(v == -1) return;
|
for(i = 0; i < arrlen(t->frames); i++) {
|
||||||
|
int y = MwGetInteger(handle, MwNheight);
|
||||||
|
|
||||||
MwVaApply(t->frames[v],
|
if(i == v) tab_height(handle) + MwDefaultBorderWidth(handle);
|
||||||
MwNx, MwDefaultBorderWidth(handle),
|
|
||||||
MwNy, tab_height(handle) + MwDefaultBorderWidth(handle),
|
MwVaApply(t->frames[i],
|
||||||
MwNwidth, MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2,
|
MwNx, MwDefaultBorderWidth(handle),
|
||||||
MwNheight, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2,
|
MwNy, y,
|
||||||
NULL);
|
MwNwidth, MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2,
|
||||||
|
MwNheight, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MwClassRec MwTabClassRec = {
|
MwClassRec MwTabClassRec = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue