exstatusbar - sample code

How can I display a percent or a progress-bar inside the panel?

VBA (MS Access, Excell...)

12345678910111213With StatusBar1
	.BeginUpdate 
	.VisualAppearance.Add 4,"c:\exontrol\images\border.ebn"
	.VisualAppearance.Add 5,"CP:4 1 1 -1 -1"
	.BackColorPanels = &H5000000
	.BackColor = &H8000000f
	.Format = "1/2,(24;5/6)"
	With .Panel(5)
		.Text = "15%"
		.Percent = 15
	End With
	.EndUpdate 
End With

VB6

12345678910111213With StatusBar1
	.BeginUpdate 
	.VisualAppearance.Add 4,"c:\exontrol\images\border.ebn"
	.VisualAppearance.Add 5,"CP:4 1 1 -1 -1"
	.BackColorPanels = &H5000000
	.BackColor = &H8000000f
	.Format = "1/2,(24;5/6)"
	With .Panel(5)
		.Text = "15%"
		.Percent = 15
	End With
	.EndUpdate 
End With

VB.NET

12345678910111213With Exstatusbar1
	.BeginUpdate()
	.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
	.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
	.BackColorPanels32 = &H5000000
	.BackColor32 = &H8000000f
	.Format = "1/2,(24;5/6)"
	With .get_Panel(5)
		.Text = "15%"
		.Percent = 15
	End With
	.EndUpdate()
End With

VB.NET for /COM

12345678910111213With AxStatusBar1
	.BeginUpdate()
	.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
	.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
	.GetOcx().BackColorPanels = &H5000000
	.GetOcx().BackColor = &H8000000f
	.Format = "1/2,(24;5/6)"
	With .get_Panel(5)
		.Text = "15%"
		.Percent = 15
	End With
	.EndUpdate()
End With

C++

123456789101112131415161718/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSTATUSBARLib' for the library: 'ExStatusBar 1.0 Control Library'

	#import <ExStatusBar.dll>
	using namespace EXSTATUSBARLib;
*/
EXSTATUSBARLib::IStatusBarPtr spStatusBar1 = GetDlgItem(IDC_STATUSBAR1)->GetControlUnknown();
spStatusBar1->BeginUpdate();
spStatusBar1->GetVisualAppearance()->Add(4,"c:\\exontrol\\images\\border.ebn");
spStatusBar1->GetVisualAppearance()->Add(5,"CP:4 1 1 -1 -1");
spStatusBar1->PutBackColorPanels(0x5000000);
spStatusBar1->PutBackColor(0x8000000f);
spStatusBar1->PutFormat(L"1/2,(24;5/6)");
EXSTATUSBARLib::IPanelPtr var_Panel = spStatusBar1->GetPanel(long(5));
	var_Panel->PutText(L"15%");
	var_Panel->PutPercent(15);
spStatusBar1->EndUpdate();

C++ Builder

12345678910StatusBar1->BeginUpdate();
StatusBar1->VisualAppearance->Add(4,TVariant("c:\\exontrol\\images\\border.ebn"));
StatusBar1->VisualAppearance->Add(5,TVariant("CP:4 1 1 -1 -1"));
StatusBar1->BackColorPanels = 0x5000000;
StatusBar1->BackColor = 0x8000000f;
StatusBar1->Format = L"1/2,(24;5/6)";
Exstatusbarlib_tlb::IPanelPtr var_Panel = StatusBar1->Panel[TVariant(5)];
	var_Panel->Text = L"15%";
	var_Panel->Percent = 15;
StatusBar1->EndUpdate();

C#

12345678910exstatusbar1.BeginUpdate();
exstatusbar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn");
exstatusbar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1");
exstatusbar1.BackColorPanels32 = 0x5000000;
exstatusbar1.BackColor32 = 0x8000000f;
exstatusbar1.Format = "1/2,(24;5/6)";
exontrol.EXSTATUSBARLib.Panel var_Panel = exstatusbar1.get_Panel(5);
	var_Panel.Text = "15%";
	var_Panel.Percent = 15;
exstatusbar1.EndUpdate();

JavaScript

1234567891011121314<OBJECT classid="clsid:0885027A-DF96-481F-928C-E3E3788889BA" id="StatusBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	StatusBar1.BeginUpdate();
	StatusBar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn");
	StatusBar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1");
	StatusBar1.BackColorPanels = 83886080;
	StatusBar1.BackColor = -2147483633;
	StatusBar1.Format = "1/2,(24;5/6)";
	var var_Panel = StatusBar1.Panel(5);
		var_Panel.Text = "15%";
		var_Panel.Percent = 15;
	StatusBar1.EndUpdate();
</SCRIPT>

C# for /COM

12345678910axStatusBar1.BeginUpdate();
axStatusBar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn");
axStatusBar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1");
(axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColorPanels = 0x5000000;
(axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColor = 0x8000000f;
axStatusBar1.Format = "1/2,(24;5/6)";
EXSTATUSBARLib.Panel var_Panel = axStatusBar1.get_Panel(5);
	var_Panel.Text = "15%";
	var_Panel.Percent = 15;
axStatusBar1.EndUpdate();

X++ (Dynamics Ax 2009)

12345678910111213141516171819public void init()
{
	COM com_Panel;
	anytype var_Panel;
	;

	super();

	exstatusbar1.BeginUpdate();
	exstatusbar1.VisualAppearance().Add(4,"c:\\exontrol\\images\\border.ebn");
	exstatusbar1.VisualAppearance().Add(5,"CP:4 1 1 -1 -1");
	exstatusbar1.BackColorPanels(0x5000000);
	exstatusbar1.BackColor(0x8000000f);
	exstatusbar1.Format("1/2,(24;5/6)");
	var_Panel = exstatusbar1.Panel(COMVariant::createFromInt(5)); com_Panel = var_Panel;
		com_Panel.Text("15%");
		com_Panel.Percent(15);
	exstatusbar1.EndUpdate();
}

Delphi 8 (.NET only)

123456789101112131415with AxStatusBar1 do
begin
	BeginUpdate();
	VisualAppearance.Add(4,'c:\exontrol\images\border.ebn');
	VisualAppearance.Add(5,'CP:4 1 1 -1 -1');
	(GetOcx() as EXSTATUSBARLib.StatusBar).BackColorPanels := $5000000;
	(GetOcx() as EXSTATUSBARLib.StatusBar).BackColor := $8000000f;
	Format := '1/2,(24;5/6)';
	with get_Panel(TObject(5)) do
	begin
		Text := '15%';
		Percent := 15;
	end;
	EndUpdate();
end

Delphi (standard)

123456789101112131415with StatusBar1 do
begin
	BeginUpdate();
	VisualAppearance.Add(4,'c:\exontrol\images\border.ebn');
	VisualAppearance.Add(5,'CP:4 1 1 -1 -1');
	BackColorPanels := $5000000;
	BackColor := $8000000f;
	Format := '1/2,(24;5/6)';
	with Panel[OleVariant(5)] do
	begin
		Text := '15%';
		Percent := 15;
	end;
	EndUpdate();
end

VFP

12345678910111213with thisform.StatusBar1
	.BeginUpdate
	.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
	.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
	.BackColorPanels = 0x5000000
	.BackColor = 0x8000000f
	.Format = "1/2,(24;5/6)"
	with .Panel(5)
		.Text = "15%"
		.Percent = 15
	endwith
	.EndUpdate
endwith

dBASE Plus

12345678910111213local oStatusBar,var_Panel

oStatusBar = form.Activex1.nativeObject
oStatusBar.BeginUpdate()
oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
oStatusBar.BackColorPanels = 0x5000000
oStatusBar.BackColor = 0x8000000f
oStatusBar.Format = "1/2,(24;5/6)"
var_Panel = oStatusBar.Panel(5)
	var_Panel.Text = "15%"
	var_Panel.Percent = 15
oStatusBar.EndUpdate()

XBasic (Alpha Five)

1234567891011121314Dim oStatusBar as P
Dim var_Panel as P

oStatusBar = topparent:CONTROL_ACTIVEX1.activex
oStatusBar.BeginUpdate()
oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
oStatusBar.BackColorPanels = 83886080
oStatusBar.BackColor = -2147483633
oStatusBar.Format = "1/2,(24;5/6)"
var_Panel = oStatusBar.Panel(5)
	var_Panel.Text = "15%"
	var_Panel.Percent = 15
oStatusBar.EndUpdate()

Visual Objects

123456789101112local var_Panel as IPanel

oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:VisualAppearance:Add(4,"c:\exontrol\images\border.ebn")
oDCOCX_Exontrol1:VisualAppearance:Add(5,"CP:4 1 1 -1 -1")
oDCOCX_Exontrol1:BackColorPanels := 0x5000000
oDCOCX_Exontrol1:BackColor := 0x8000000f
oDCOCX_Exontrol1:Format := "1/2,(24;5/6)"
var_Panel := oDCOCX_Exontrol1:[Panel,5]
	var_Panel:Text := "15%"
	var_Panel:Percent := 15
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

12345678910111213OleObject oStatusBar,var_Panel

oStatusBar = ole_1.Object
oStatusBar.BeginUpdate()
oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn")
oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1")
oStatusBar.BackColorPanels = 83886080 /*0x5000000*/
oStatusBar.BackColor = -2147483633 /*0x8000000f*/
oStatusBar.Format = "1/2,(24;5/6)"
var_Panel = oStatusBar.Panel(5)
	var_Panel.Text = "15%"
	var_Panel.Percent = 15
oStatusBar.EndUpdate()

Visual DataFlex

123456789101112131415161718192021222324252627282930Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Variant voAppearance
	Get ComVisualAppearance to voAppearance
	Handle hoAppearance
	Get Create (RefClass(cComAppearance)) to hoAppearance
	Set pvComObject of hoAppearance to voAppearance
		Get ComAdd of hoAppearance 4 "c:\exontrol\images\border.ebn" to Nothing
	Send Destroy to hoAppearance
	Variant voAppearance1
	Get ComVisualAppearance to voAppearance1
	Handle hoAppearance1
	Get Create (RefClass(cComAppearance)) to hoAppearance1
	Set pvComObject of hoAppearance1 to voAppearance1
		Get ComAdd of hoAppearance1 5 "CP:4 1 1 -1 -1" to Nothing
	Send Destroy to hoAppearance1
	Set ComBackColorPanels to |CI$5000000
	Set ComBackColor to |CI$8000000f
	Set ComFormat to "1/2,(24;5/6)"
	Variant voPanel
	Get ComPanel 5 to voPanel
	Handle hoPanel
	Get Create (RefClass(cComPanel)) to hoPanel
	Set pvComObject of hoPanel to voPanel
		Set ComText of hoPanel to "15%"
		Set ComPercent of hoPanel to 15
	Send Destroy to hoPanel
	Send ComEndUpdate
End_Procedure

XBase++

1234567891011121314151617181920212223242526272829303132333435#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oPanel
	LOCAL oStatusBar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oStatusBar := XbpActiveXControl():new( oForm:drawingArea )
	oStatusBar:CLSID  := "Exontrol.StatusBar.1" /*{0885027A-DF96-481F-928C-E3E3788889BA}*/
	oStatusBar:create(,, {10,60},{610,370} )

		oStatusBar:BeginUpdate()
		oStatusBar:VisualAppearance():Add(4,"c:\exontrol\images\border.ebn")
		oStatusBar:VisualAppearance():Add(5,"CP:4 1 1 -1 -1")
		oStatusBar:BackColorPanels := 0x5000000
		oStatusBar:BackColor := 0x8000000f
		oStatusBar:Format := "1/2,(24;5/6)"
		oPanel := oStatusBar:Panel(5)
			oPanel:Text := "15%"
			oPanel:Percent := 15
		oStatusBar:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN