From: André S. <asn...@us...> - 2004-07-10 20:55:02
|
Update of /cvsroot/jvcl/dev/JVCL3/qexamples/JvOutlookBar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29581/JVCL3/qexamples/JvOutlookBar Added Files: OLBarDemo.dof OLBarDemo.dpr OLBarDemo.kof OLBarMainFormU.pas OLBarMainFormU.xfm Log Message: more examples --- NEW FILE: OLBarMainFormU.xfm --- object OLBarMainForm: TOLBarMainForm Left = 229 Top = 185 ActiveControl = Button1 AutoScroll = False Caption = 'JvOutlookBar Demo' ClientHeight = 388 ClientWidth = 697 Color = clButton Constraints.MinHeight = 300 Constraints.MinWidth = 220 Font.Color = clText Font.Height = 11 Font.Name = 'MS Sans Serif' Font.Pitch = fpVariable Font.Style = [] Font.Weight = 40 Icon.Data = { 000001000200101010000100100028010000260000002020100001001000E802 [...3492 lines suppressed...] Action = acSmallButtons end end object ActionList1: TActionList Left = 288 Top = 48 object acSmallButtons: TAction Caption = 'Small Buttons' OnExecute = acSmallButtonsExecute end object acEditButtonCaption: TAction Caption = 'Edit Button Caption' OnExecute = acEditButtonCaptionExecute end object acEditPageCaption: TAction Caption = 'Edit Page Caption' OnExecute = acEditPageCaptionExecute end end end --- NEW FILE: OLBarDemo.kof --- [Compiler] UnsafeType=0 UnsafeCode=0 UnsafeCast=0 [Directories] OutputDir=../bin UnitOutputDir=../dcu SearchPath=../../qrun:../../qcommon:../../common --- NEW FILE: OLBarDemo.dpr --- {******************************************************************************} {* WARNING: JEDI VCL To CLX Converter generated unit. *} {* Manual modifications will be lost on next release. *} {******************************************************************************} program OLBarDemo; uses QForms, OLBarMainFormU in 'OLBarMainFormU.pas' {OLBarMainForm}; {$R *.res} begin Application.Initialize; Application.CreateForm(TOLBarMainForm, OLBarMainForm); Application.Run; end. --- NEW FILE: OLBarMainFormU.pas --- {******************************************************************************} {* WARNING: JEDI VCL To CLX Converter generated unit. *} {* Manual modifications will be lost on next release. *} {******************************************************************************} {****************************************************************** JEDI-VCL Demo Copyright (C) 2002 Project JEDI Original author: Contributor(s): You may retrieve the latest version of this file at the JEDI-JVCL home page, located at http://jvcl.sourceforge.net The contents of this file are used with permission, subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1_1Final.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ******************************************************************} {$I jvcl.inc} unit OLBarMainFormU; interface uses QWindows, QMessages, SysUtils, Variants, Classes, Types, QGraphics, QControls, QForms, QDialogs, JvQOutlookBar, QComCtrls, QStdCtrls, QMenus, QExtCtrls, QImgList, JvQComponent, JvQExControls, QActnList, QTypes; type TOLBarMainForm = class(TForm) popOL: TPopupMenu; Splitter1: TSplitter; ImageList1: TImageList; ImageList2: TImageList; Defaultpopupmenu1: TMenuItem; popButton: TPopupMenu; popPage: TPopupMenu; Editbuttoncaption1: TMenuItem; Editpagecaption1: TMenuItem; StatusBar1: TStatusBar; JvOutlookBar1: TJvOutlookBar; Panel1: TPanel; Panel2: TPanel; Button1: TButton; chkSmallImages: TCheckBox; Button2: TButton; Button3: TButton; chkButtonFont: TCheckBox; Smallbuttons1: TMenuItem; Smallbuttons2: TMenuItem; ActionList1: TActionList; acSmallButtons: TAction; acEditButtonCaption: TAction; acEditPageCaption: TAction; chkFlat: TCheckBox; Memo1: TMemo; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure JvOutlookBar1ButtonClick(Sender: TObject; Index: Integer); procedure JvOutlookBar1PageChanging(Sender: TObject; Index: Integer; var AllowChange: Boolean); procedure JvOutlookBar1PageChange(Sender: TObject; Index: Integer); procedure JvOutlookBar1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); procedure acSmallButtonsExecute(Sender: TObject); procedure acEditButtonCaptionExecute(Sender: TObject); procedure acEditPageCaptionExecute(Sender: TObject); procedure chkFlatClick(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } end; var OLBarMainForm: TOLBarMainForm; implementation {$R *.xfm} procedure TOLBarMainForm.Button1Click(Sender: TObject); begin JvOutlookBar1.LargeImages := ImageList1; JvOutlookBar1.SmallImages := ImageList2; end; procedure TOLBarMainForm.Button2Click(Sender: TObject); begin JvOutlookBar1.LargeImages := nil; JvOutlookBar1.SmallImages := nil; end; procedure TOLBarMainForm.Button3Click(Sender: TObject); var i:integer; FD:TFontDialog; begin FD := TFontDialog.Create(nil); try if not chkButtonFont.Checked then FD.Font := JvOutlookBar1.Font else FD.Font := JvOutlookBar1.ActivePage.Font; if FD.Execute then begin if not chkButtonFont.Checked then JvOutlookBar1.Font := FD.Font // this sets the font of all the pages else for i := 0 to JvOutlookBar1.Pages.Count - 1 do JvOutlookBar1.Pages[i].Font := FD.Font; // this sets the button's fonts! end; finally FD.Free; end; end; procedure TOLBarMainForm.JvOutlookBar1ButtonClick(Sender: TObject; Index: Integer); var P:TJvOutlookBarPage; begin if (Index > -1) then with JvOutlookBar1 do begin P := Pages[ActivePageIndex]; Caption := Format('Clicked button "%s" on page "%s"',[P.Buttons[Index].Caption,P.Caption]); end; end; procedure TOLBarMainForm.JvOutlookBar1PageChanging(Sender: TObject; Index: Integer; var AllowChange: Boolean); begin with JvOutlookBar1 do if (ActivePageIndex > -1) and (Index > -1) then Caption := Format('Page changing from "%s" to "%s"', [Pages[ActivePageIndex].Caption, Pages[Index].Caption]); end; procedure TOLBarMainForm.JvOutlookBar1PageChange(Sender: TObject; Index: Integer); begin if Index > -1 then Caption := Format('Page changed to "%s"',[JvOutlookBar1.Pages[Index].Caption]); end; procedure TOLBarMainForm.JvOutlookBar1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); begin with Sender as TJvOutlookbar do if PopupObject is TJvOutlookBarPage then PopUpMenu := popPage else if PopupObject is TJvOutlookBarButton then PopUpMenu := popButton else PopUpMenu := popOL; end; procedure TOLBarMainForm.acSmallButtonsExecute(Sender: TObject); const cButtonSize: array[boolean] of TJvBarButtonSize = (olbsLarge,olbsSmall); begin acSmallButtons.Checked := not acSmallButtons.Checked; JvOutlookBar1.ButtonSize := cButtonSize[acSmallButtons.Checked]; end; procedure TOLBarMainForm.acEditButtonCaptionExecute(Sender: TObject); begin with JvOutlookBar1.PopUpObject as TJvOutlookBarButton do EditCaption; end; procedure TOLBarMainForm.acEditPageCaptionExecute(Sender: TObject); begin with JvOutlookBar1.PopUpObject as TJvOutlookBarPage do EditCaption; end; procedure TOLBarMainForm.chkFlatClick(Sender: TObject); const cBorderStyle:array [boolean] of TBorderStyle = (bsSingle, bsNone); begin JvOutlookbar1.BorderStyle := cBorderStyle[chkFlat.Checked]; end; procedure TOLBarMainForm.FormCreate(Sender: TObject); begin Memo1.Wordwrap := True; end; end. --- NEW FILE: OLBarDemo.dof --- [Compiler] UnsafeType=0 UnsafeCode=0 UnsafeCast=0 [Directories] OutputDir=..\bin UnitOutputDir=..\dcu SearchPath=..\..\qrun;..\..\qcommon;..\..\common |