home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************\
- * *
- * ActiveX.jfm -- Sample ActiveX Form *
- * *
- * ActiveX.jfm demonstrates the use of an ActiveX control on an IntraBuilder *
- * form. The Microsoft graph control is used. This control ships with IE 3.0, *
- * so no codebase property is necessary. The classId is enough to identify *
- * the control to IE 3.0. The params of the control are set both in the *
- * control definition and in the form's onServerLoad event. The onServerLoad *
- * computes the total orders by state and stores the data to the control. *
- * *
- * Dependencies: customer.dbf *
- * orders.dbf *
- * *
- * Updated 11/13/96 by IntraBuilder Samples Group *
- * $Revision: 1.3 $ *
- * *
- * Copyright (c) 1996, Borland International, Inc. All rights reserved. *
- * *
- \****************************************************************************/
- // {End Header} Do not remove this comment//
- // Generated on 11/13/96
- //
- var f = new activexForm();
- f.open();
- class activexForm extends Form {
- _sys.scripts.load("CHART.CC")
- with (this) {
- onServerLoad = class::form_onServerLoad;
- height = 14.6667;
- left = 0;
- top = 0;
- width = 76;
- title = "ActiveX Sample";
- }
-
-
- with (this.query1 = new Query()){
- left = 34;
- top = 8;
- sql = "select c.state_prov, sum(o.total) as sumTotal from customer c, orders o where c.customer_n = o.customer_n group by c.state_prov";
-
- active = true;
- }
-
-
- with (this.query1.rowset) {
-
- }
-
-
- with (this.ActiveXChartQuery1 = new ActiveXChartQuery(this)){
- height = 13;
- top = 1.5;
- width = 74;
- params["ChartType"] = "8";
-
- }
-
-
- with (this.html1 = new HTML(this)){
- height = 1.5;
- width = 74;
- color = "black";
- alignHorizontal = 1;
- text = "Total Sales by State (in U.S. Dollars)";
- }
-
-
- with (this.html2 = new HTML(this)){
- height = 1;
- top = 14.5;
- width = 74;
- color = "black";
- alignHorizontal = 1;
- text = "(Data computed from customer.dbf and orders.dbf.)";
- }
-
-
- with (this.button1 = new Button(this)){
- onClick = class::button1_onClick;
- left = 18;
- top = 16;
- width = 10.5;
- text = "Back";
- }
-
-
- with (this.switchViewButton = new Button(this)){
- onClick = class::switchViewButton_onClick;
- left = 42;
- top = 16;
- width = 16;
- text = "Switch View";
- }
-
- this.rowset = this.query1.rowset;
-
- function form_onServerLoad()
- {
- this.ActiveXChartQuery1.Init("state_prov","sumTotal",this.query1.rowset);
- }
-
- function button1_onClick()
- {
- history.back();
- }
-
- function switchViewButton_onClick()
- {
- var ChartType = document.forms[0].ActiveXChartQuery1.ChartType;
- if (ChartType == 5)
- ChartType = 8;
- else if (ChartType == 8)
- ChartType = 14;
- else
- ChartType = 5;
- document.forms[0].ActiveXChartQuery1.ChartType = ChartType;
- }
-
- }
-