Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
0a12b8d2
Commit
0a12b8d2
authored
Jul 23, 2003
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@675
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
d372fd42
Changes
2
Hide whitespace changes
Inline
Side-by-side
flext.vcproj
View file @
0a12b8d2
...
...
@@ -377,7 +377,9 @@
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
Name=
"VCPostBuildEventTool"
Description=
"copy flext to maestra"
CommandLine=
"copy F:\prog\max\flext\pd-msvc\flext_ld.dll F:\prog\maestra\dev\debug"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
...
...
@@ -440,7 +442,12 @@
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
Name=
"VCPostBuildEventTool"
Description=
"copy flext to maestra"
CommandLine=
"copy F:\prog\max\flext\source\*.h F:\prog\maestra\dev\api\include
copy F:\prog\max\flext\pd-msvc\flext_l.lib F:\prog\maestra\dev\api\lib
copy F:\prog\max\flext\pd-msvc\flext_l.dll F:\prog\maestra\dev\Release
"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
...
...
source/flattr_ed.cpp
View file @
0a12b8d2
...
...
@@ -39,7 +39,7 @@ void flext_base::SetAttrEditor(t_classid c)
widgetbehavior
.
w_selectfn
=
c
->
c_wb
->
w_selectfn
;
widgetbehavior
.
w_activatefn
=
c
->
c_wb
->
w_activatefn
;
widgetbehavior
.
w_deletefn
=
c
->
c_wb
->
w_deletefn
;
ori_vis
=
c
->
c_wb
->
w_visfn
;
ori_vis
=
c
->
c_wb
->
w_visfn
;
widgetbehavior
.
w_visfn
=
cb_GfxVis
;
widgetbehavior
.
w_clickfn
=
c
->
c_wb
->
w_clickfn
;
widgetbehavior
.
w_propertiesfn
=
cb_GfxProperties
;
...
...
@@ -93,7 +93,7 @@ void flext_base::SetAttrEditor(t_classid c)
"proc pdtk_flext_dialog {id attrlist} {
\n
"
"set vid [string trimleft $id .]
\n
"
"set alen [expr [llength $attrlist] /
3
]
\n
"
"set alen [expr [llength $attrlist] /
4
]
\n
"
"toplevel $id
\n
"
"wm title $id {object attributes}
\n
"
...
...
@@ -104,29 +104,48 @@ void flext_base::SetAttrEditor(t_classid c)
*/
"set ix 0
\n
"
"foreach {an av asv} $attrlist {
\n
"
"foreach {an av asv afl} $attrlist {
\n
"
// generate variable name
"set nm [concat $id.nm-$ix]
\n
"
// get attribute name
"set var_attr_name [concat [concat var_name_$ix]_$vid ]
\n
"
"global $var_attr_name
\n
"
"set $var_attr_name $an
\n
"
// get attribute value (list)
"set var_attr_val [concat [concat var_val_$ix]_$vid ]
\n
"
"global $var_attr_val
\n
"
"set $var_attr_val $av
\n
"
// format value list
"set $var_attr_val {}
\n
"
"foreach i $av {
\n
"
"if { [string is double $i] } {
\n
"
// it's a number.. take as many digits as necessary
"lappend $var_attr_val [format %g $i]
\n
"
"} else {
\n
"
// it's a string, append unchanged
"lappend $var_attr_val $i
\n
"
"}
\n
"
"}
\n
"
// get save flag
"set var_attr_save [concat [concat var_save_$ix]_$vid ]
\n
"
"global $var_attr_save
\n
"
"set $var_attr_save $asv
\n
"
// add dialog elements to window
"frame $nm
\n
"
"pack $nm -side top
\n
"
"label $nm.lwidth -text
\"
$an :
\"\n
"
"entry $nm.width -textvariable $var_attr_val -width 20
\n
"
"checkbutton $nm.save -text {save} -variable $var_attr_save -anchor w
\n
"
"pack $nm.lwidth $nm.width $nm.save -side left
\n
"
"bind $nm.width <KeyPress-Return> [concat flext_ok $id $alen]
\n
"
"foreach i {0 1 2} { radiobutton $nm.b$i -value $i -variable $var_attr_save }
\n
"
"pack $nm.lwidth $nm.width $nm.b0 $nm.b1 $nm.b2 -side left
\n
"
// increase counter
"incr ix
\n
"
"}
\n
"
...
...
@@ -199,7 +218,7 @@ void flext_base::cb_GfxProperties(t_gobj *c, t_glist *)
// \TODO set flag for tcl/tk dialog
}
STD
::
sprintf
(
b
,
"} %i "
,
sv
?
1
:
0
);
b
+=
strlen
(
b
);
STD
::
sprintf
(
b
,
"} %i
%i
"
,
sv
?
1
:
0
,
attr
?
(
attr
->
BothExist
()
?
2
:
1
)
:
0
);
b
+=
strlen
(
b
);
}
strcpy
(
b
,
" }
\n
"
);
...
...
@@ -308,13 +327,13 @@ bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
i
+=
cnt
;
FLEXT_ASSERT
(
i
<
argc
);
bool
sv
=
CanbeBool
(
argv
[
i
])
&&
GetABool
(
argv
[
i
]);
int
sv
=
GetAInt
(
argv
[
i
]);
++
i
;
// find settable attribute
attritem
*
attr
=
th
->
FindAttrib
(
aname
,
false
);
if
(
attr
)
{
th
->
SetAttribSave
(
attr
,
sv
);
th
->
SetAttribSave
(
attr
,
sv
!=
0
);
bool
ret
=
th
->
SetAttrib
(
attr
,
cnt
,
argv
+
offs
);
FLEXT_ASSERT
(
ret
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment