background pixmap
This commit is contained in:
parent
e57f3fd910
commit
363897df74
8 changed files with 29 additions and 17 deletions
|
|
@ -35,9 +35,7 @@ static void draw(MwWidget handle) {
|
|||
} else {
|
||||
MwDrawWidgetBack(handle, &r, base, handle->pressed, 1);
|
||||
}
|
||||
if(bgpx != NULL) {
|
||||
MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
}
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
if(MwGetInteger(handle, MwNflat) && !handle->pressed) {
|
||||
r.x += MwDefaultBorderWidth(handle);
|
||||
r.y += MwDefaultBorderWidth(handle);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ static int create(MwWidget handle) {
|
|||
static void draw(MwWidget handle) {
|
||||
MwRect r;
|
||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
|
|
@ -18,6 +19,7 @@ static void draw(MwWidget handle) {
|
|||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawWidgetBack(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0, MwTRUE);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
if(handle->pressed || MwGetInteger(handle, MwNchecked)) {
|
||||
/* TODO: write check mark */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ static void draw(MwWidget handle) {
|
|||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
const char* str = MwGetText(handle, MwNtext);
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
if(str == NULL) str = "";
|
||||
|
||||
r.x = 0;
|
||||
|
|
@ -33,6 +34,7 @@ static void draw(MwWidget handle) {
|
|||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawWidgetBack(handle, &r, base, 1, 1);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
if(str != NULL) {
|
||||
int w = MwTextWidth(handle, "M");
|
||||
int h = MwTextHeight(handle, "M");
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ static void draw(MwWidget handle) {
|
|||
MwRect rr;
|
||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
int inverted;
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
if(MwGetInteger(handle, MwNhasBorder)) {
|
||||
inverted = MwGetInteger(handle, MwNinverted);
|
||||
|
|
@ -36,6 +37,7 @@ static void draw(MwWidget handle) {
|
|||
}
|
||||
|
||||
MwDrawRect(handle, &rr, base);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &rr, bgpx);
|
||||
|
||||
MwLLFreeColor(base);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ static void draw(MwWidget handle) {
|
|||
MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
int align;
|
||||
const char* str = MwGetText(handle, MwNtext);
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
if(str == NULL) str = "";
|
||||
|
||||
|
|
@ -24,6 +25,7 @@ static void draw(MwWidget handle) {
|
|||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawRect(handle, &r, base);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
|
||||
align = MwGetInteger(handle, MwNalignment);
|
||||
if(align == MwALIGNMENT_CENTER) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ static void draw(MwWidget handle) {
|
|||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
MwLLColor fill = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
double w;
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
|
|
@ -26,6 +27,7 @@ static void draw(MwWidget handle) {
|
|||
MwDrawRect(handle, &r, base);
|
||||
w = MwGetInteger(handle, MwNvalue) - MwGetInteger(handle, MwNminValue);
|
||||
w = w / (MwGetInteger(handle, MwNmaxValue) - MwGetInteger(handle, MwNminValue));
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
|
||||
r.x += MwDefaultBorderWidth(handle);
|
||||
r.y += MwDefaultBorderWidth(handle);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ static int create(MwWidget handle) {
|
|||
static void draw(MwWidget handle) {
|
||||
MwRect r;
|
||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
|
|
@ -20,6 +21,7 @@ static void draw(MwWidget handle) {
|
|||
r.height = MwGetInteger(handle, MwNheight);
|
||||
|
||||
MwDrawRect(handle, &r, base);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
MwDrawDiamond(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0);
|
||||
|
||||
MwLLFreeColor(base);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ static void draw(MwWidget handle) {
|
|||
scrollbar_t* scr = handle->internal;
|
||||
int or ;
|
||||
int uy, dy, ux, dx;
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
|
|
@ -79,6 +80,7 @@ static void draw(MwWidget handle) {
|
|||
dx = r.width - r.height;
|
||||
|
||||
MwDrawWidgetBack(handle, &r, dark, 1, MwTRUE);
|
||||
if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx);
|
||||
|
||||
rt = r;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue