TempleOSCD_150720.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:22 +02:00
1 parent 401601816c
commit f8c05f98f4
554 files changed
+26046 -24853

No files matched your search

+11 -9
View File
@@ -1,4 +1,4 @@
#define BUTTBORDER 2
#define BUTTON_BORDER 2
#define BTF_DONT_FREE 1
@@ -21,11 +21,12 @@ U0 DrawCtrlButton(CDC *dc,CCtrl *c)
st=s->state_texts;
dc->color=s->state_colors[s->state];
l=StrLen(st);
GrRect(dc,c->left+BUTTBORDER,c->top+BUTTBORDER,
c->right-c->left+1-BUTTBORDER*2,c->bottom-c->top+1-BUTTBORDER*2);
GrRect(dc,c->left+BUTTON_BORDER,c->top+BUTTON_BORDER,
c->right-c->left+1-BUTTON_BORDER*2,
c->bottom-c->top+1-BUTTON_BORDER*2);
dc->color=s->state_colors[s->state]^(WHITE<<16+WHITE);
GrPrint(dc,(c->left+c->right+1-l*FONT_WIDTH)>>1,
(c->top+c->bottom+1-FONT_HEIGHT)>>1,"%s",st);
(c->top+c->bottom+1-FONT_HEIGHT)>>1,"%s",st);
}
U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down)
@@ -39,7 +40,8 @@ U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down)
}
public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
I64 num_states=1,U8 *state_texts,I32 state_colors[],CCtrlButtonState *_s=NULL)
I64 num_states=1,U8 *state_texts,
I32 state_colors[],CCtrlButtonState *_s=NULL)
{//Create button ctrl. See $LK,"::/Apps/Strut/Strut.CPP"$.
Bool old_preempt;
CCtrl *result;
@@ -53,9 +55,9 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
j=StrLen(st);
if (j>l) l=j;
}
width=BUTTBORDER*4+l*FONT_WIDTH;
width=BUTTON_BORDER*4+l*FONT_WIDTH;
}
if (height<0) height=BUTTBORDER*4+FONT_HEIGHT;
if (height<0) height=BUTTON_BORDER*4+FONT_HEIGHT;
result=CAlloc(sizeof(CCtrl));
if (_s) {
s=_s;
@@ -77,7 +79,7 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
result->top=y;
result->right=result->left+width-1;
result->bottom=result->top+height-1;
old_preempt=Preempt(OFF);
old_preempt=Preempt;
QueIns(result,Fs->last_ctrl);
Preempt(old_preempt);
return result;
@@ -85,7 +87,7 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
public U0 CtrlButtonDel(CCtrl *c)
{//Free button ctrl.
Bool old_preempt=Preempt(OFF);
Bool old_preempt=Preempt;
QueRem(c);
Preempt(old_preempt);
if (!(c->flags&BTF_DONT_FREE))