![]() |
Page Control, normales Design weg und ein Viereck hin
Hi,
wie mach ich das. OwnerDraw und PageControlDrawTab. Aber was dann, ich hab hier schon gesucht aber nichts passendes gefunden ? Ein anderes Problem ist ganz einfach neue Tabs per MenüItem klick hinzuzufügen und das wird dann noch komplizierter. |
Re: Page Control, normales Design weg und ein Viereck hin
Zum 2. Problem:
Zitat Delphi Hilfe: NewTabSheet = TTabSheet.Create(PageControl1); NewTabSheet.PageControl := PageControl1; Zitat Ende Zum 1. Problem keine Ahnung :| |
Re: Page Control, normales Design weg und ein Viereck hin
Liste der Anhänge anzeigen (Anzahl: 1)
Delphi-Quellcode:
Das Problem ist, das in _sTabCaptions dann immer alles definiert werden muss, deshalb geht die eben vorgeschlagene Methode wahrscheinlich nicht.
var
aRect, bRect: TRect { ... } procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); const _clTabColors : array [0..1] of TColor = (clGray,clGray); _sTabCaptions : array [0..3] of string = ('tab1','tab2', 'tab3', 'tab4'); begin aRect := PageControl1.TabRect(PageControl1.ActivePageIndex); bRect := PageControl1.TabRect(PageControl1.ActivePageIndex); Control.Canvas.Brush.Color := _clTabColors[TabIndex]; Control.Canvas.Rectangle(0, 0, 60, 20); Control.Canvas.FillRect(bRect); Control.Canvas.FillRect(aRect); Control.Canvas.TextOut(aRect.Left+5,Rect.Top+3,_sTabCaptions[TabIndex]); end; Im Attachment seht ihr zwei Tabs, wie sie aussehen sollen. |
Re: Page Control, normales Design weg und ein Viereck hin
Keiner eine Idee :( ?
Weiß keiner von euch, wie man Tabs wie in d2005 darstellt :( ? |
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
aenogym |
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
|
Re: Page Control, normales Design weg und ein Viereck hin
Torry vllt.
|
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
|
Re: Page Control, normales Design weg und ein Viereck hin
Welches Package ist es denn bei jvcl ?
Ist es die JvTabBar-Unit ? Wenn ja, wie bau ich sie in mein Programm ein ? |
Re: Page Control, normales Design weg und ein Viereck hin
Installier doch die Jedis (mit dem Installer), aber nur die packages, die du willst.
|
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
|
Re: Page Control, normales Design weg und ein Viereck hin
:(
|
Re: Page Control, normales Design weg und ein Viereck hin
Bei
![]() ![]() für nicht kommerzielle benutzung kostenlos! :) |
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
|
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
|
Re: Page Control, normales Design weg und ein Viereck hin
Zitat:
Zitat:
![]() |
Re: Page Control, normales Design weg und ein Viereck hin
Jedi legt gleich die ganze IDE lahm, weil es verdammt viel zu laden gibt und wie gesagt, ich kann es bei Delphi 7 nicht installieren :(
Wie könnte ich es denn selber programmieren ? |
Re: Page Control, normales Design weg und ein Viereck hin
Sry, aber:
Delphi-Quellcode:
Was muss ich tun, damit die Tabs so aussehen, damit so so aussehen, wie sie aussehen sollen ? Der rest ist schon flat.
unit FlatPageControl1;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls; type TFlatPageControl1 = class(TPageControl) private FFlat: Boolean; procedure SetFlat(const Value: Boolean); protected procedure WMPaint(var Msg: TWMPaint); message WM_PAINT; public constructor Create(Owner: TComponent); override; published property Flat: Boolean read FFlat write SetFlat; end; procedure Register; implementation procedure Register; begin RegisterComponents('Zusätzlich', [TFlatPageControl1]); end; constructor TFlatPageControl1.Create(Owner: TComponent); begin inherited; FFlat := False; end; procedure TFlatPageControl1.SetFlat(const Value: Boolean); begin if FFlat <> Value then begin FFlat := Value; Repaint; end; end; procedure TFlatPageControl1.WMPaint(var Msg: TWMPaint); var R: TRect; begin inherited; if FFlat and (Style = tsTabs) and (TabPosition = tpTop) then begin R := ClientRect; R.Top := DisplayRect.Top - 4; Canvas.Pen.Color := clBtnFace; Canvas.Pen.Width := 3; Canvas.PolyLine([Point(R.Left - 1, R.Top), Point(R.Left - 1, R.Bottom)]); Canvas.Pen.Width := 2; Canvas.PolyLine([Point(R.Left, R.Bottom - 1), Point(R.Right - 1, R.Bottom - 1), Point(R.Right - 1, R.Top)]); end; end; end. |
Re: Page Control, normales Design weg und ein Viereck hin
Könnte man da nichts hinzufügen ? Es gibt ja
Delphi-Quellcode:
Und kann man da unter Style oder so etwas einbauen ?
property Flat: Boolean read FFlat write SetFlat;
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz