Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
87a99cfe
Commit
87a99cfe
authored
Feb 09, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows and folders added
parent
15552bbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
0 deletions
+136
-0
xtt/lib/glow/src/glow_exportjbean.cpp
xtt/lib/glow/src/glow_exportjbean.cpp
+126
-0
xtt/lib/glow/src/glow_exportjbean.h
xtt/lib/glow/src/glow_exportjbean.h
+10
-0
No files found.
xtt/lib/glow/src/glow_exportjbean.cpp
View file @
87a99cfe
...
...
@@ -1885,6 +1885,132 @@ void GlowExportJBean::axis( double x1, double y1, double x2, double y2,
}
}
void
GlowExportJBean
::
window
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
char
*
filename
,
int
vertical_scrollbar
,
int
horizontal_scrollbar
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
)
{
double
dim_x0
,
dim_x1
,
dim_y0
,
dim_y1
;
char
var_name
[
40
];
char
class_name
[]
=
"JScrollPane"
;
char
class_fname
[
80
];
char
var_fname
[
80
];
char
*
s
;
strcpy
(
var_name
,
class_name
);
var_name
[
0
]
=
_tolower
(
var_name
[
0
]);
sprintf
(
&
var_name
[
strlen
(
var_name
)],
"%d"
,
node_cnt
);
// Convert filename to java class
strcpy
(
class_fname
,
filename
);
if
(
(
s
=
strchr
(
class_fname
,
'.'
)))
*
s
=
0
;
sprintf
(
var_fname
,
"%s%d"
,
class_fname
,
node_cnt
);
class_fname
[
0
]
=
_toupper
(
class_fname
[
0
]);
switch
(
pass
)
{
case
glow_eExportPass_Shape
:
break
;
case
glow_eExportPass_Declare
:
{
fp
<<
" "
<<
class_name
<<
" "
<<
var_name
<<
";"
<<
endl
;
break
;
}
case
glow_eExportPass_Attributes
:
{
((
GrowCtx
*
)
ctx
)
->
measure_javabean
(
&
dim_x1
,
&
dim_x0
,
&
dim_y1
,
&
dim_y0
);
fp
<<
" "
<<
class_fname
<<
" "
<<
var_fname
<<
" = new "
<<
class_fname
<<
"(session, null, false);"
<<
endl
<<
" "
<<
var_name
<<
" = new "
<<
class_name
<<
"("
<<
var_fname
<<
".localPanel);"
<<
endl
<<
" "
<<
var_name
<<
".setBounds(new Rectangle("
<<
(
int
)(
x1
-
dim_x0
/* - glow_cJBean_Offset) */
)
<<
","
<<
(
int
)(
y1
-
dim_y0
/* - glow_cJBean_Offset) */
)
<<
","
<<
(
int
)(
x2
-
x1
+
2
*
glow_cJBean_Offset
)
<<
","
<<
(
int
)(
y2
-
y1
+
2
*
glow_cJBean_Offset
)
<<
"));"
<<
endl
<<
" localPanel.add("
<<
var_name
<<
", null);"
<<
endl
;
break
;
}
case
glow_eExportPass_Draw
:
break
;
default:
;
}
}
void
GlowExportJBean
::
folder
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
int
folders
,
char
*
folder_file_names
,
char
*
folder_text
,
int
*
folder_v_scrollbar
,
int
*
folder_h_scrollbar
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
)
{
double
dim_x0
,
dim_x1
,
dim_y0
,
dim_y1
;
char
var_name
[
40
];
char
class_name
[]
=
"JTabbedPane"
;
char
class_fname
[
80
];
char
var_fname
[
80
];
char
*
s
;
strcpy
(
var_name
,
class_name
);
var_name
[
0
]
=
_tolower
(
var_name
[
0
]);
sprintf
(
&
var_name
[
strlen
(
var_name
)],
"%d"
,
node_cnt
);
switch
(
pass
)
{
case
glow_eExportPass_Shape
:
break
;
case
glow_eExportPass_Declare
:
{
fp
<<
" "
<<
class_name
<<
" "
<<
var_name
<<
";"
<<
endl
;
break
;
}
case
glow_eExportPass_Attributes
:
{
((
GrowCtx
*
)
ctx
)
->
measure_javabean
(
&
dim_x1
,
&
dim_x0
,
&
dim_y1
,
&
dim_y0
);
fp
<<
" "
<<
var_name
<<
" = new "
<<
class_name
<<
"();"
<<
endl
;
char
*
fname_p
=
folder_file_names
;
char
*
text_p
=
folder_text
;
for
(
int
i
=
0
;
i
<
folders
;
i
++
)
{
strcpy
(
class_fname
,
fname_p
);
if
(
(
s
=
strchr
(
class_fname
,
'.'
)))
*
s
=
0
;
sprintf
(
var_fname
,
"%s%d_%d"
,
class_fname
,
node_cnt
,
i
);
class_fname
[
0
]
=
_toupper
(
class_fname
[
0
]);
fp
<<
" "
<<
class_fname
<<
" "
<<
var_fname
<<
" = new "
<<
class_fname
<<
"(session, null, false);"
<<
endl
;
if
(
folder_v_scrollbar
[
i
]
||
folder_h_scrollbar
[
i
])
fp
<<
" "
<<
var_name
<<
".addTab(
\"
"
<<
text_p
<<
"
\"
, new JScrollPane("
<<
var_fname
<<
".localPanel));"
<<
endl
;
else
fp
<<
" "
<<
var_name
<<
".addTab(
\"
"
<<
text_p
<<
"
\"
, "
<<
var_fname
<<
".localPanel);"
<<
endl
;
fname_p
+=
80
;
text_p
+=
80
;
}
fp
<<
" "
<<
var_name
<<
".setBounds(new Rectangle("
<<
(
int
)(
x1
-
dim_x0
/* - glow_cJBean_Offset) */
)
<<
","
<<
(
int
)(
y1
-
dim_y0
/* - glow_cJBean_Offset) */
)
<<
","
<<
(
int
)(
x2
-
x1
+
2
*
glow_cJBean_Offset
)
<<
","
<<
(
int
)(
y2
-
y1
+
2
*
glow_cJBean_Offset
)
<<
"));"
<<
endl
<<
" localPanel.add("
<<
var_name
<<
", null);"
<<
endl
;
break
;
}
case
glow_eExportPass_Draw
:
break
;
default:
;
}
}
void
GlowExportJBean
::
slider
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
char
*
class_name
,
glow_eDrawType
border_drawtype
,
...
...
xtt/lib/glow/src/glow_exportjbean.h
View file @
87a99cfe
...
...
@@ -121,6 +121,16 @@ class GlowExportJBean {
int
text_idx
,
char
*
format
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
void
window
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
char
*
filename
,
int
vertical_scrollbar
,
int
horizontal_scrollbar
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
void
folder
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
int
folders
,
char
*
folder_file_names
,
char
*
folder_text
,
int
*
folder_v_scrollbar
,
int
*
folder_h_scrollbar
,
glow_eExportPass
pass
,
int
*
shape_cnt
,
int
node_cnt
,
ofstream
&
fp
);
void
slider
(
double
x1
,
double
y1
,
double
x2
,
double
y2
,
char
*
class_name
,
glow_eDrawType
border_drawtype
,
...
...
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