Changes from Nagy Zsolt

Shane

git-svn-id: trunk@242 -
This commit is contained in:
lazarus 2001-03-27 14:27:43 +00:00
parent 3416b940e1
commit 56b97ad5b7
5 changed files with 176 additions and 74 deletions

View File

@ -1179,8 +1179,9 @@ begin
//get the control name
nmControlType := _Control.name;
writeln('Calling GetAncestor');
Ancestor := GetAncestor;
Writeln('Called');
//find the place in the code to start looking for it
For I := 0 to TempSource.Count-1 do
@ -1289,9 +1290,16 @@ Function TSourceEditor.GetAncestor : String;
var
PI : PTypeInfo;
begin
PI := FControl.ClassInfo;
Result := PI^.Name;
Delete(Result,1,1);
writeln('In Get Ancewstor');
if (FControl <> nil) then
Begin
PI := FControl.ClassInfo;
Writeln('1');
Result := PI^.Name;
Writeln('2');
Delete(Result,1,1);
Writeln('3');
end;
end;

View File

@ -43,6 +43,98 @@ Begin
End;
End;
(*Procedure TBevel.Paint;
Var
Colora, Colorb:TColor;
Begin
Case Style Of
bsRaised:
Begin
Colora:=clWhite;
Colorb:=clGray;
End;
bsLowered:
Begin
Colora:=clGray;
Colorb:=clWhite;
End;
End;
Canvas.Pen.Width:=1;
Case Shape Of
bsBox:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 1);
LineTo(Left, Top);
LineTo(Left + Width - 2, Top);
Pen.Color:=Colorb;
LineTo(Left + Width - 2, Top + Height - 1);
LIneTo(Left , Top + Height - 1);
End;
bsFrame:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 1);
LineTo(Left, Top);
LineTo(Left + Width - 1, Top);
MoveTo(Left + Width - 2, Top + 1);
LineTo(Left + Width - 2, Top + Height - 2);
LineTo(Left + 1, Top + Height - 2);
Pen.Color:=Colorb;
MoveTo(Left + 1, Top + Height - 2);
LineTo(Left + 1, Top + 1);
LineTo(Left + Width - 2, Top + 1);
MoveTo(Left + Width - 1, Top);
LineTo(Left + Width - 1, Top + Height - 1);
LineTo(Left, Top + Height - 1);
End;
bsTopLine:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top);
LineTo(Left + Width - 1, Top);
Pen.Color:=Colorb;
MoveTo(Left, Top + 1);
LineTo(Left + Width - 1, Top + 1);
End;
bsBottomLine:
With Canvas Do
Begin
Pen.Color:=Colorb;
MoveTo(Left, Top + Height - 1);
LineTo(Left + Width - 1, Top + Height - 1);
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 2);
LineTo(Left + Width - 1, Top + Height - 2);
End;
bsLeftLine:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top);
LineTo(Left, Top + Height - 1);
Pen.Color:=Colorb;
MoveTo(Left + 1, Top);
LineTo(Left + 1, Top + Height - 1);
End;
bsRightLine:
With Canvas Do
Begin
Pen.Color:=Colorb;
MoveTo(Left + Width - 1, Top);
LineTo(Left + Width - 1, Top + Height - 1);
Pen.Color:=Colora;
MoveTo(Left + Width - 2, Top);
LineTo(Left + Width - 2, Top + Height);
End;
End;
End;
*)
Procedure TBevel.Paint;
Var
Colora, Colorb:TColor;
@ -132,6 +224,10 @@ End;
{
$Log$
Revision 1.2 2001/03/27 14:27:43 lazarus
Changes from Nagy Zsolt
Shane
Revision 1.1 2000/07/13 10:28:24 michael
+ Initial import

View File

@ -56,70 +56,61 @@ begin
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ TStatusBar DrawBevel }
{------------------------------------------------------------------------------}
Procedure TStatusBar.DrawBevel(xLeft, PanelNum : Integer );
var
Colora,Colorb:TColor;
Begin
//writeln('[TStatusBar.DrawBevel] ',Canvas.Classname);
Canvas.Brush.Color := color;
Canvas.FillRect(Rect(XLeft,Top,XLeft +Panels[PanelNum].Width,Top+Height));
if (Panels[PanelNum].Bevel = pbRaised) then
with Canvas do begin
Pen.Width:=1;
Pen.Color := clWhite;
Line(XLeft,Top,XLeft+Panels[PanelNum].Width-1,Top);
Line(XLeft,Top,XLeft,Top+Height-1);
Line(XLeft,Top+1,XLeft+Panels[PanelNum].Width-1,Top+1);
Line(XLeft+1,Top,XLeft+1,Top+Height-1);
Pen.Color := clBlack;
Line(XLeft,Top+Height-5,XLeft+Panels[PanelNum].Width-1,Top+Height-5);
Line(XLeft+Panels[PanelNum].Width-2,Top,XLeft+Panels[PanelNum].Width-2,Top+Height-1);
Line(XLeft,Top+Height-6,XLeft+Panels[PanelNum].Width-1,Top+Height-6);
Line(XLeft+Panels[PanelNum].Width-3,Top,XLeft+Panels[PanelNum].Width-3,Top+Height-2);
end
else
Canvas.Brush.Color := Color;
Canvas.FillRect(Rect(XLeft,Top,XLeft+Panels[PanelNum].Width,Top+Height));
if Panels[PanelNum].Bevel = pbRaised then
begin
Colora:=clWhite;
Colorb:=clGray;
end;
if Panels[PanelNum].Bevel = pbLowered then
Begin
Canvas.Pen.Color := clBlack;
Canvas.Line(XLeft,Top,XLeft+Panels[PanelNum].Width-1,Top);
Canvas.Line(XLeft,Top,XLeft,Top+Height-1);
Canvas.Line(XLeft,Top+1,XLeft+Panels[PanelNum].Width-1,Top+1);
Canvas.Line(XLeft+1,Top,XLeft+1,Top+Height-1);
Canvas.Pen.Color := clWhite;
Canvas.Line(XLeft,Top+Height-5,XLeft+Panels[PanelNum].Width-1,Top+Height-5);
Canvas.Line(XLeft+Panels[PanelNum].Width-1,Top,XLeft+Panels[PanelNum].Width-1,Top+Height-1);
Canvas.Line(XLeft,Top+Height-6,XLeft+Panels[PanelNum].Width-1,Top+Height-6);
Canvas.Line(XLeft+Panels[PanelNum].Width-2,Top,XLeft+Panels[PanelNum].Width-2,Top+Height-4);
end
else
if Panels[PanelNum].Bevel = pbNone then
Begin
{ Canvas.Pen.Color := clBlack;
Canvas.Line(XLeft,Top,XLeft+Panels[PanelNum].Width-1,Top);
Canvas.Line(XLeft,Top,XLeft,Top+Height-1);
Canvas.Line(XLeft,Top+Height-1,XLeft+Panels[PanelNum].Width-1,Top+Height-1);
Canvas.Line(XLeft+Panels[PanelNum].Width-1,Top,XLeft+Panels[PanelNum].Width-1,Top+Height-1);
}
end
begin
Colora:=clGray;
Colorb:=clWhite;
end;
Canvas.Pen.Width:=1;
if (Panels[PanelNum].Bevel = pbRaised) or (Panels[PanelNum].Bevel = pbLowered) then
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(XLeft,Top+Height-1);
LineTo(XLeft,Top);
LineTo(XLeft+Panels[PanelNum].Width-1,Top);
Pen.Color:=Colorb;
LineTo(XLeft+Panels[PanelNum].Width-1,Top+Height-1);
LIneTo(XLeft,Top+Height-1);
End;
End;
Procedure TStatusBar.DrawDivider(X : Integer);
Begin
Canvas.Pen.Color := clWhite;
Canvas.Line(X,Top,X,Top+Height);
Canvas.Pen.Color := clBlack;
Canvas.Line(X+1,Top,X+1,Top+Height);
Canvas.Pen.Width:=1;
Canvas.Pen.Color := clBtnFace;
Canvas.Line(X,Top,X,Top+Height-1);
Canvas.Pen.Color := clBtnFace;
Canvas.Line(X+1,Top,X+1,Top+Height-1);
End;
Procedure TStatusBar.WMPaint(var Msg: TLMPaint);
var
I : Integer;
X,Y : Integer;
X,Y,X2 : Integer;
Begin
//Writeln('[TSTATUSBAR].WMPAINT');
inherited;
X2:=(Height-Canvas.TextHeight('L')) div 2;
if SimplePanel = False then
Begin
if Panels.Count = 0 then exit;
@ -129,22 +120,16 @@ Begin
For I := 0 to Panels.Count-1 do
Begin
if I = Panels.Count-1 then
Panels[I].Width := Width-X; //this sets the last panel to the width of the statusbar
Panels[I].Width := ClientWidth-X; //this sets the last panel to the width of the statusbar
DrawBevel(X,I);
Canvas.TextOut(X+2,Y+2,Panels[i].Text);
Canvas.TextOut(X+2,Y+X2,Panels[i].Text);
//draw divider
if I < Panels.Count-1 then
DrawDivider(X+Panels[i].Width);
X := X + Panels[i].Width +1;
// Writeln('SimplePanel = False');
// Writeln('Panels[0].Text = '+Panels[0].Text);
inc(X);
X := X + Panels[i].Width+1;
end;
// ExtTextOut(Handle,1,1,0,nil,pchar(Panels[0].Text),Length(Panels[0].Text),nil);
end
else
if SimplePanel = True then
Begin
Canvas.TextOut(Left+2,Top+2,SimpleText);
end;
else Canvas.TextOut(Left+2,Top+X2,SimpleText);
End;

View File

@ -1589,18 +1589,20 @@ end;
------------------------------------------------------------------------------}
procedure TWinControl.WMWindowPosChanged(var Message : TLMWindowPosChanged);
begin
if Message.WindowPos <> nil
then with Message.WindowPos^ do
begin
FLeft := X;
FWidth := cX;
FTop := Y;
FHeight := cY;
Assert(False, Format('Trace:[TWinControl.WMWindowPosChanged] %s --> Message.WindowPos(%d, %d)(%d, %d)', [ClassName, X, Y, cx, cy]));
end
else Assert(False, Format('Trace:[TWinControl.WMWindowPosChanged] %s --> Message.WindowPos = nil', [ClassName]));
Writeln('[TWINCONTROL].WMWINDOWPOSCHANGED');
if Message.WindowPos <> nil then
with Message.WindowPos^ do
begin
Writeln(Format('Sizes are %d,%d,%d,%d',[X,Y,cx,cy]));
FLeft := X;
FWidth := cX;
FTop := Y;
FHeight := cY;
Assert(False, Format('Trace:[TWinControl.WMWindowPosChanged] %s --> Message.WindowPos(%d, %d)(%d, %d)', [ClassName, X, Y, cx, cy]));
end
else Assert(False, Format('Trace:[TWinControl.WMWindowPosChanged] %s --> Message.WindowPos = nil', [ClassName]));
inherited WMWindowPosChanged(Message);
inherited WMWindowPosChanged(Message);
end;
@ -1963,6 +1965,10 @@ end;
{ =============================================================================
$Log$
Revision 1.27 2001/03/27 14:27:43 lazarus
Changes from Nagy Zsolt
Shane
Revision 1.26 2001/03/26 14:58:31 lazarus
MG: setwindowpos + bugfixes

View File

@ -1824,7 +1824,10 @@ begin
begin
Assert(Sender is TForm);
p := gtk_window_new(FormStyleMap[TForm(Sender).BorderStyle]);
gtk_container_set_border_width(GTK_CONTAINER(P), 2);
// I comment the next line because this causes that when I align something
// it's right and bottom don't visible.
//Nagy Zsolt 2001/03/27
// gtk_container_set_border_width(GTK_CONTAINER(P), 2);
TempInt:= FormSizeableMap[TForm(Sender).BorderStyle];
gtk_window_set_policy (GTK_WINDOW (p), TempInt, TempInt, 0);
gtk_window_set_title(pGtkWindow(p), strTemp);
@ -2772,6 +2775,10 @@ end;
{ =============================================================================
$Log$
Revision 1.41 2001/03/27 14:27:43 lazarus
Changes from Nagy Zsolt
Shane
Revision 1.40 2001/03/26 14:58:31 lazarus
MG: setwindowpos + bugfixes