TempleOSCDV5.00.ISO
This commit is contained in:
1 parent
122df6338e
commit
f6eacf7744
374 files changed
+11078
-11204
No files matched your search
@@ -203,7 +203,7 @@ U0 WinScrollsInit(CTask *task)
|
||||
if (!CtrlFindUnique(task,CTRLT_WIN_HSCROLL)) {
|
||||
c=CAlloc(sizeof(CCtrl));
|
||||
c->win_task=task;
|
||||
c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_WIN_HSCROLL;
|
||||
c->state=&task->horz_scroll;
|
||||
c->update_derived_vals=&WinDerivedScrollValsUpdate;
|
||||
@@ -215,7 +215,7 @@ U0 WinScrollsInit(CTask *task)
|
||||
if (!CtrlFindUnique(task,CTRLT_WIN_VSCROLL)) {
|
||||
c=CAlloc(sizeof(CCtrl));
|
||||
c->win_task=task;
|
||||
c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_WIN_VSCROLL;
|
||||
c->state=&task->vert_scroll;
|
||||
c->update_derived_vals=&WinDerivedScrollValsUpdate;
|
||||
@@ -364,7 +364,7 @@ public CCtrl *ViewAnglesNew(CTask *task=NULL)
|
||||
s->cy=GREEN;
|
||||
s->cz=LTGREEN;
|
||||
c->win_task=task;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_VIEWING_ANGLES;
|
||||
c->state=s;
|
||||
c->draw_it=&DrawViewAnglesCtrl;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#define BUTTON_BORDER 2
|
||||
#define BTTN_BORDER 2
|
||||
|
||||
#define BTF_DONT_FREE 1
|
||||
|
||||
class CCtrlButtonState
|
||||
class CCtrlBttnState
|
||||
{
|
||||
I64 state,num_states,flags;
|
||||
U8 *state_texts;
|
||||
CColorROPU32 *state_colors;
|
||||
};
|
||||
|
||||
U0 DrawCtrlButton(CDC *dc,CCtrl *c)
|
||||
U0 DrawCtrlBttn(CDC *dc,CCtrl *c)
|
||||
{
|
||||
CCtrlButtonState *s=c->state;
|
||||
CCtrlBttnState *s=c->state;
|
||||
I64 l;
|
||||
U8 *st;
|
||||
|
||||
@@ -21,17 +21,17 @@ U0 DrawCtrlButton(CDC *dc,CCtrl *c)
|
||||
st=s->state_texts;
|
||||
dc->color=s->state_colors[s->state];
|
||||
l=StrLen(st);
|
||||
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);
|
||||
GrRect(dc,c->left+BTTN_BORDER,c->top+BTTN_BORDER,
|
||||
c->right-c->left+1-BTTN_BORDER*2,
|
||||
c->bottom-c->top+1-BTTN_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);
|
||||
}
|
||||
|
||||
U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down)
|
||||
U0 LeftClickCtrlBttn(CCtrl *c,I64,I64,Bool down)
|
||||
{
|
||||
CCtrlButtonState *s=c->state;
|
||||
CCtrlBttnState *s=c->state;
|
||||
if (down) {
|
||||
s->state++;
|
||||
if (s->state==s->num_states)
|
||||
@@ -39,12 +39,12 @@ U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down)
|
||||
}
|
||||
}
|
||||
|
||||
public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
|
||||
public CCtrl *CtrlBttnNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
|
||||
I64 num_states=1,U8 *state_texts,
|
||||
I32 *state_colors,CCtrlButtonState *_s=NULL)
|
||||
{//Create button ctrl. See $LK,"::/Apps/Strut/Strut.HC"$.
|
||||
I32 *state_colors,CCtrlBttnState *_s=NULL)
|
||||
{//Create bttn ctrl. See $LK,"::/Apps/Strut/Strut.HC"$.
|
||||
CCtrl *res;
|
||||
CCtrlButtonState *s;
|
||||
CCtrlBttnState *s;
|
||||
I64 i,j,l;
|
||||
U8 *st;
|
||||
if (width<0) {
|
||||
@@ -54,15 +54,15 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
|
||||
j=StrLen(st);
|
||||
if (j>l) l=j;
|
||||
}
|
||||
width=BUTTON_BORDER*4+l*FONT_WIDTH;
|
||||
width=BTTN_BORDER*4+l*FONT_WIDTH;
|
||||
}
|
||||
if (height<0) height=BUTTON_BORDER*4+FONT_HEIGHT;
|
||||
if (height<0) height=BTTN_BORDER*4+FONT_HEIGHT;
|
||||
res=CAlloc(sizeof(CCtrl));
|
||||
if (_s) {
|
||||
s=_s;
|
||||
MemSet(s,0,sizeof(CCtrlButtonState));
|
||||
MemSet(s,0,sizeof(CCtrlBttnState));
|
||||
} else {
|
||||
s=CAlloc(sizeof(CCtrlButtonState));
|
||||
s=CAlloc(sizeof(CCtrlBttnState));
|
||||
s->flags=BTF_DONT_FREE;
|
||||
}
|
||||
s->num_states=num_states;
|
||||
@@ -72,8 +72,8 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
|
||||
res->flags=CTRLF_SHOW;
|
||||
res->type=CTRLT_GENERIC;
|
||||
res->state=s;
|
||||
res->draw_it=&DrawCtrlButton;
|
||||
res->left_click=&LeftClickCtrlButton;
|
||||
res->draw_it=&DrawCtrlBttn;
|
||||
res->left_click=&LeftClickCtrlBttn;
|
||||
res->left=x;
|
||||
res->top=y;
|
||||
res->right=res->left+width-1;
|
||||
@@ -82,8 +82,8 @@ public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1,
|
||||
return res;
|
||||
}
|
||||
|
||||
public U0 CtrlButtonDel(CCtrl *c)
|
||||
{//Free button ctrl.
|
||||
public U0 CtrlBttnDel(CCtrl *c)
|
||||
{//Free bttn ctrl.
|
||||
QueRem(c);
|
||||
if (!(c->flags&BTF_DONT_FREE))
|
||||
Free(c->state);
|
||||
@@ -176,7 +176,7 @@ CCtrl *SliderNew()
|
||||
{
|
||||
CCtrl *c=CAlloc(sizeof(CCtrl));
|
||||
c->win_task=Fs;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_GENERIC;
|
||||
");
|
||||
if (*m->glbl_name)
|
||||
|
||||
@@ -3,6 +3,6 @@ Cd(__DIR__);;
|
||||
#help_index "Ctrls"
|
||||
#help_file "::/Doc/Ctrls"
|
||||
#include "CtrlsA"
|
||||
#include "CtrlsButton"
|
||||
#include "CtrlsBttn"
|
||||
#include "CtrlsSlider"
|
||||
Cd("..");;
|
||||
Reference in new issue
Block a user