From: <jfu...@us...> - 2012-07-19 21:49:10
|
Revision: 13386 http://jvcl.svn.sourceforge.net/jvcl/?rev=13386&view=rev Author: jfudickar Date: 2012-07-19 21:49:04 +0000 (Thu, 19 Jul 2012) Log Message: ----------- Improved Examples Modified Paths: -------------- trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.dfm trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.pas trunk/jvcl/examples/JvProgramVersionCheck/Main.dfm trunk/jvcl/examples/JvProgramVersionCheck/Main.pas trunk/jvcl/examples/JvThread/fThread.dfm trunk/jvcl/examples/JvThread/fThread.pas Modified: trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.dfm =================================================================== --- trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.dfm 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.dfm 2012-07-19 21:49:04 UTC (rev 13386) @@ -214,7 +214,6 @@ Lines.Strings = ( 'Select * from user_objects') TabOrder = 3 - ExplicitHeight = 250 end object OraSession1: TOraSession DataTypeMap = <> Modified: trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.pas =================================================================== --- trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.pas 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvDBOdacComponents/JvDBOdacComponentsMainForm.pas 2012-07-19 21:49:04 UTC (rev 13386) @@ -1,5 +1,7 @@ unit JvDBOdacComponentsMainForm; +{$I jvcl.inc} + interface uses @@ -9,7 +11,12 @@ JvDBPasswordDialogOdac, MemDS, OraSmart, JvOdacSmartQuery, JvDBActions, ActnList, JvActionsEngine, Buttons, JvDBLogonDialogBaseDevart, JvDBActionsEngineDatasetDevart, - JvDynControlEngineJVCL, JvComponentBase, JvAppStorage, JvAppRegistryStorage; + {$IFDEF USE_3RDPARTY_DEVEXPRESS_CXEDITOR} + JvDynControlEngineDevExpCx, + {$ELSE} + JvDynControlEngineJVCL, + {$ENDIF} + JvComponentBase, JvAppStorage, JvAppRegistryStorage; type TForm1 = class(TForm) Modified: trunk/jvcl/examples/JvProgramVersionCheck/Main.dfm =================================================================== --- trunk/jvcl/examples/JvProgramVersionCheck/Main.dfm 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvProgramVersionCheck/Main.dfm 2012-07-19 21:49:04 UTC (rev 13386) @@ -2,8 +2,8 @@ Left = 357 Top = 242 Caption = 'Form1' - ClientHeight = 379 - ClientWidth = 468 + ClientHeight = 502 + ClientWidth = 558 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Modified: trunk/jvcl/examples/JvProgramVersionCheck/Main.pas =================================================================== --- trunk/jvcl/examples/JvProgramVersionCheck/Main.pas 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvProgramVersionCheck/Main.pas 2012-07-19 21:49:04 UTC (rev 13386) @@ -2,6 +2,8 @@ interface +{$I jvcl.inc} + uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, JvProgramVersionCheck, JvComponent, JvAppStorage, JvAppIniStorage, @@ -24,7 +26,7 @@ procedure Button2Click(Sender: TObject); procedure FormShow(Sender: TObject); public - procedure VersionCheck; + procedure VersionCheck; end; var @@ -35,7 +37,11 @@ {$R *.dfm} Uses JclFileUtils, JvTypes, JvPropertyStoreEditor, - JvDynControlEngineJVCLInspector, JvDynControlEngineJVCL; + JvDynControlEngineJVCLInspector, JvDynControlEngineJVCL + {$IFDEF USE_3RDPARTY_DEVEXPRESS_CXEDITOR} + , JvDynControlEngineDevExpCx + {$ENDIF} + ; procedure TForm1.Button1Click(Sender: TObject); begin @@ -57,12 +63,13 @@ procedure TForm1.VersionCheck; begin - with ProgramVersionCheck do - begin - Execute ; - end; + ProgramVersionCheck.Execute ; end; begin + {$IFDEF USE_3RDPARTY_DEVEXPRESS_CXEDITOR} + RegisterJvDynControlRTTIInspectorControl(DynControlEngineDevExpCx); + {$ELSE} RegisterJvDynControlRTTIInspectorControl(DynControlEngineJVCL); + {$ENDIF} end. Modified: trunk/jvcl/examples/JvThread/fThread.dfm =================================================================== --- trunk/jvcl/examples/JvThread/fThread.dfm 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvThread/fThread.dfm 2012-07-19 21:49:04 UTC (rev 13386) @@ -4,7 +4,7 @@ BorderIcons = [biSystemMenu, biMinimize] BorderStyle = bsSingle Caption = 'JvThread Demo' - ClientHeight = 143 + ClientHeight = 201 ClientWidth = 364 Color = clBtnFace DefaultMonitor = dmDesktop @@ -65,7 +65,7 @@ object Button3: TButton Left = 121 Top = 18 - Width = 100 + Width = 145 Height = 25 Caption = 'Start Job 1 &Dialog' TabOrder = 2 @@ -74,12 +74,21 @@ object Button4: TButton Left = 121 Top = 69 - Width = 100 + Width = 145 Height = 25 - Caption = 'Start Job 2 D&ialog' + Caption = 'Start Job 2 D&ialog Animated' TabOrder = 3 OnClick = Button4Click end + object Button5: TButton + Left = 121 + Top = 138 + Width = 145 + Height = 25 + Caption = 'Start Job 3 &Sizing Dialog' + TabOrder = 4 + OnClick = Button3Click + end object JvThread1: TJvThread Exclusive = True MaxCount = 0 @@ -118,7 +127,7 @@ DialogOptions.CancelButtonCaption = 'Cancel' DialogOptions.Caption = 'Execute Thread' DialogOptions.InfoText = 'Infotext'#13#10'<yx<yx'#13#10'<y'#13#10'x' - DialogOptions.CommonAVI = aviCopyFiles + DialogOptions.CommonAVI = aviFindFile Left = 260 Top = 80 end Modified: trunk/jvcl/examples/JvThread/fThread.pas =================================================================== --- trunk/jvcl/examples/JvThread/fThread.pas 2012-07-19 21:47:00 UTC (rev 13385) +++ trunk/jvcl/examples/JvThread/fThread.pas 2012-07-19 21:49:04 UTC (rev 13386) @@ -48,6 +48,7 @@ JvThreadAnimateDialog1: TJvThreadAnimateDialog; Button3: TButton; Button4: TButton; + Button5: TButton; procedure JvThread1Execute(Sender: TObject; params: Pointer); procedure Button1Click(Sender: TObject); procedure JvThread2Execute(Sender: TObject; params: Pointer); @@ -55,7 +56,11 @@ procedure FormDestroy(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button3Click(Sender: TObject); + procedure ThreadDialogChangeThreadDialogOptions(DialogOptions: TJvThreadBaseDialogOptions); private + ThreadInfoProgressBarPosition: Integer; + ThreadInfoText: string; + procedure OnThreadExecute(Sender: TObject; Params: Pointer); public Value: Integer; Value2: Integer; @@ -80,7 +85,7 @@ //Do the job here k := 0; for i := 0 to 100 do - for j := 0 to 500 do + for j := 0 to 800 do begin Inc(k); @@ -160,10 +165,62 @@ end; procedure TForm1.Button3Click(Sender: TObject); +var + Thread: TJvThread; + ThreadDialog: TJvThreadSimpleDialog; begin - JvThread1.ThreadDialog := JvThreadSimpleDialog1; - JvThread1.Execute(Self); - //(Sender as TButton).Enabled := False; + Thread := TJvThread.Create(Self); + ThreadDialog := TJvThreadSimpleDialog.Create(Self); + try + Thread.Name := 'Thread'; + Thread.Exclusive := True; + Thread.MaxCount := 0; + Thread.RunOnCreate := True; + Thread.FreeOnTerminate := True; + Thread.ThreadDialog := ThreadDialog; + Thread.OnExecute := OnThreadExecute; + ThreadDialog.Name := 'ThreadDialog'; + ThreadDialog.ChangeThreadDialogOptions := ThreadDialogChangeThreadDialogOptions; + ThreadDialog.DialogOptions.Caption := 'Sizing Thread Sample'; + ThreadDialog.DialogOptions.ShowCancelButton := False; + ThreadDialog.DialogOptions.ShowDialog := True; + ThreadDialog.DialogOptions.ShowModal := True; + ThreadDialog.DialogOptions.ShowProgressBar := True; + Thread.ExecuteWithDialog(nil); + finally + Thread.Free; + ThreadDialog.Free; + end; + end; +procedure TForm1.ThreadDialogChangeThreadDialogOptions(DialogOptions: TJvThreadBaseDialogOptions); +begin + DialogOptions.InfoText := ThreadInfoText; + if DialogOptions is TJvThreadSimpleDialogOptions then + TJvThreadSimpleDialogOptions(DialogOptions).ProgressbarPosition := ThreadInfoProgressBarPosition; +end; + +procedure TForm1.OnThreadExecute(Sender: TObject; Params: Pointer); +var + i: Integer; +begin +// (TBaseSQLUtility(Params)); + for i := 0 to 20 do + begin + ThreadInfoProgressBarPosition := i; + case i mod 5 of + 1 : ThreadInfoText := 'Das ist ein Test'; + 2 : ThreadInfoText := 'ist ein Test'; + 3 : ThreadInfoText := 'Das ist ein sehr sehr sehr langer Test der nicht zu umbr\xFCchen f\xFChrt'; + 4 : ThreadInfoText := 'Das ist ein langer Test der nicht zu umbr\xFCchen f\xFChrt'; + 5 : ThreadInfoText := 'Das ist ein langer Test der zu umbr\xFCchen f\xFChrt'; + else + ThreadInfoText := 'Das ist ein anderer Test der auch zu lang wird und daher nicht passt'; + end; + Sleep(1000); + end; + +end; + end. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |