mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-19 07:08:21 +02:00
Shane
git-svn-id: trunk@87 -
This commit is contained in:
parent
93c09674f1
commit
27f9719f6a
77
ide/main.pp
77
ide/main.pp
@ -187,7 +187,6 @@ type
|
|||||||
//these numbers are used to determine where the mouse was when the button was pressed
|
//these numbers are used to determine where the mouse was when the button was pressed
|
||||||
MouseDownPos, MouseUpPos, LastMouseMovePos : TPoint;
|
MouseDownPos, MouseUpPos, LastMouseMovePos : TPoint;
|
||||||
MouseDownControl: TObject;
|
MouseDownControl: TObject;
|
||||||
bpressed : Integer;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1224,69 +1223,6 @@ begin
|
|||||||
FormEditor1.AddSelected(AComponent);
|
FormEditor1.AddSelected(AComponent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
{
|
|
||||||
Currently Unused !
|
|
||||||
Used when we a control is clicked. This is used
|
|
||||||
to update the Object Inspector.
|
|
||||||
}
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
{Procedure TForm1.ClickOnControl(Sender : TObject);
|
|
||||||
// We clicked on the form. Let's see what the active selection is in the IDE
|
|
||||||
// control bar. If it's the pointer, then we set the
|
|
||||||
// FormEditor1.SelectedComponents to Sender,
|
|
||||||
// otherwise we drop a control and call the CreateComponent function.
|
|
||||||
var
|
|
||||||
ParentCI, NewCI : TComponentInterface;
|
|
||||||
CurDesigner:TDesigner;
|
|
||||||
NewLeft, NewTop, NewWidth, NewHeight : Integer;
|
|
||||||
Begin
|
|
||||||
if BPressed = 1 then
|
|
||||||
Begin //mouse button pressed.
|
|
||||||
FormEditor1.ClearSelected;
|
|
||||||
Writeln('Clicked on the control!!!!! Control name is '+TControl(sender).name);
|
|
||||||
// this will automatically inform the object inspector
|
|
||||||
FormEditor1.AddSelected(TComponent(Sender));
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Begin //add a new control
|
|
||||||
ParentCI:=TComponentInterface(FormEditor1.FindComponent(TComponent(Sender)));
|
|
||||||
if Assigned(ParentCI) then begin
|
|
||||||
NewLeft:=Min(MouseDownPos.X,MouseUpPos.X);
|
|
||||||
NewWidth:=Abs(MouseUpPos.X-MouseDownPos.X);
|
|
||||||
NewTop:=Min(MouseDownPos.Y,MouseUpPos.Y);
|
|
||||||
NewHeight:=Abs(MouseUpPos.Y-MouseDownPos.Y);
|
|
||||||
NewCI := TComponentInterface(FormEditor1.CreateComponent(ParentCI,
|
|
||||||
TComponentClass(TIdeComponent(ideComplist.items[bpressed-1]).ClassType)
|
|
||||||
,NewLeft,NewTop,NewWidth,NewHeight));
|
|
||||||
NewCI.SetPropByName('Visible',True); //Control).Visible := True;
|
|
||||||
|
|
||||||
//set the ONCLICK event so we know when the control is selected;
|
|
||||||
TControl(NewCI.Control).OnClick := @ClickOnControl;
|
|
||||||
|
|
||||||
if NewCI.Control is TControl then begin
|
|
||||||
NewCI.SetPropByName('OnClick',@ClickOnControl);
|
|
||||||
// select form in Designer
|
|
||||||
if ParentCI.Control is TForm then
|
|
||||||
CurDesigner:=TDesigner(TForm(ParentCI.Control).Designer)
|
|
||||||
else if Assigned(ParentCI.Control.Owner)
|
|
||||||
and (ParentCI.Control.Owner is TForm) then
|
|
||||||
CurDesigner:=TDesigner(TForm(ParentCI.Control.Owner).Designer)
|
|
||||||
else
|
|
||||||
CurDesigner:=nil;
|
|
||||||
if (CurDesigner<>nil) then begin
|
|
||||||
CurDesigner.ControlSelection.Clear;
|
|
||||||
CurDesigner.ControlSelection.Add(TControl(NewCI.Control));
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
ControlClick(Notebook1); //this resets it to the mouse.
|
|
||||||
end;}
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -1314,7 +1250,7 @@ Begin
|
|||||||
Writeln(TComponent(Sender).Name+'.OnMouseDown at '+inttostr(MouseDownPos.x)
|
Writeln(TComponent(Sender).Name+'.OnMouseDown at '+inttostr(MouseDownPos.x)
|
||||||
+','+inttostr(MouseDownPos.Y)+' x='+IntToStr(x));
|
+','+inttostr(MouseDownPos.Y)+' x='+IntToStr(x));
|
||||||
|
|
||||||
if BPressed = 1 then
|
if SelectedComponent = nil then
|
||||||
Begin //mouse pointer button pressed.
|
Begin //mouse pointer button pressed.
|
||||||
if not (Sender is TCustomForm) then begin
|
if not (Sender is TCustomForm) then begin
|
||||||
SelectOnlyThisComponent(TComponent(Sender));
|
SelectOnlyThisComponent(TComponent(Sender));
|
||||||
@ -1334,7 +1270,7 @@ Begin
|
|||||||
end else begin
|
end else begin
|
||||||
CurDesigner:=FindDesigner(TComponent(Sender));
|
CurDesigner:=FindDesigner(TComponent(Sender));
|
||||||
if Assigned(MouseDownControl) then begin
|
if Assigned(MouseDownControl) then begin
|
||||||
if BPressed = 1 then begin
|
if SelectedComponent = nil then begin
|
||||||
// mouse pointer button pressed
|
// mouse pointer button pressed
|
||||||
if not (Sender is TCustomForm) then begin
|
if not (Sender is TCustomForm) then begin
|
||||||
// move selection
|
// move selection
|
||||||
@ -1401,6 +1337,7 @@ Begin
|
|||||||
end;
|
end;
|
||||||
NewCI := TComponentInterface(FormEditor1.CreateComponent(ParentCI,SelectedComponent.ComponentClass
|
NewCI := TComponentInterface(FormEditor1.CreateComponent(ParentCI,SelectedComponent.ComponentClass
|
||||||
,NewLeft,NewTop,NewWidth,NewHeight));
|
,NewLeft,NewTop,NewWidth,NewHeight));
|
||||||
|
NewCI.SetPropByName('Designing',True);
|
||||||
NewCI.SetPropByName('Visible',True); //Control).Visible := True;
|
NewCI.SetPropByName('Visible',True); //Control).Visible := True;
|
||||||
|
|
||||||
ObjectInspector1.FillComponentComboBox;
|
ObjectInspector1.FillComponentComboBox;
|
||||||
@ -1489,10 +1426,7 @@ Procedure TForm1.FileOpenedEvent(Sender : TObject; Filename : String);
|
|||||||
var
|
var
|
||||||
MenuItem : TMenuItem;
|
MenuItem : TMenuItem;
|
||||||
Begin
|
Begin
|
||||||
//Writeln('OPENFILE... = '+OPenFilePopupmenu.Items[0].Caption);
|
//Add a new menuitem to the popup that displays the filename.
|
||||||
//if OPenFilePopupmenu.Items[0].Caption = 'No files have been opened' then
|
|
||||||
// OPenFilePopupmenu.Items.Delete(0);
|
|
||||||
Writeln('Filename is '+filename);
|
|
||||||
MenuItem := TMenuItem.Create(Self);
|
MenuItem := TMenuItem.Create(Self);
|
||||||
MenuItem.Caption := Filename;
|
MenuItem.Caption := Filename;
|
||||||
MenuItem.OnClick := @SourceNotebook.OpenClicked;
|
MenuItem.OnClick := @SourceNotebook.OpenClicked;
|
||||||
@ -1809,8 +1743,7 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.26 2000/12/29 17:50:52 lazarus
|
Revision 1.27 2000/12/29 19:20:27 lazarus
|
||||||
Added a dropdown image to the resource and a downarrow button by the OPEN button.
|
|
||||||
Shane
|
Shane
|
||||||
|
|
||||||
Revision 1.25 2000/12/29 13:35:50 lazarus
|
Revision 1.25 2000/12/29 13:35:50 lazarus
|
||||||
|
@ -8,7 +8,7 @@ begin
|
|||||||
fCompStyle := csStatusBar;
|
fCompStyle := csStatusBar;
|
||||||
Align := alBottom;
|
Align := alBottom;
|
||||||
|
|
||||||
Setbounds(0,TWinControl(AOwner).Height-15,TWInControl(AOwner).Width,15);
|
Setbounds(0,TWinControl(AOwner).Height-21,TWInControl(AOwner).Width,20);
|
||||||
|
|
||||||
|
|
||||||
FContext := 0;
|
FContext := 0;
|
||||||
@ -26,7 +26,7 @@ begin
|
|||||||
if FSimpleText <> value then
|
if FSimpleText <> value then
|
||||||
begin
|
begin
|
||||||
FSimpleText := Value;
|
FSimpleText := Value;
|
||||||
Msg.Panel := 0;
|
Msg.Panel := length(Value);//0;
|
||||||
Msg.fCompStyle := fCompStyle;
|
Msg.fCompStyle := fCompStyle;
|
||||||
gLAbel := StrAlloc(length(value) + 1);
|
gLAbel := StrAlloc(length(value) + 1);
|
||||||
StrPCopy(gLabel,Value);
|
StrPCopy(gLabel,Value);
|
||||||
|
@ -979,9 +979,14 @@ end;
|
|||||||
procedure TgtkObject.SetText(Child, Data: Pointer);
|
procedure TgtkObject.SetText(Child, Data: Pointer);
|
||||||
type
|
type
|
||||||
pMsg = ^TLMSetControlText;
|
pMsg = ^TLMSetControlText;
|
||||||
|
var
|
||||||
|
num : Integer;
|
||||||
begin
|
begin
|
||||||
case pMsg(Data)^.fCompStyle of
|
case pMsg(Data)^.fCompStyle of
|
||||||
csStatusBar : gtk_statusbar_push(PGTKStatusBar(Child),pMsg(Data)^.Panel,pMsg(Data)^.Userdata);
|
csStatusBar : begin
|
||||||
|
num := gtk_statusbar_get_context_id(PGTKStatusBar(Child),PChar(inttostr(pMsg(Data)^.panel)));
|
||||||
|
gtk_statusbar_push(PGTKStatusBar(Child),num,pMsg(Data)^.Userdata);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
writeln ('STOPPOK: [TGtkObject.SetText] Possible superfluous use of SetText, use SetLabel instead!');
|
writeln ('STOPPOK: [TGtkObject.SetText] Possible superfluous use of SetText, use SetLabel instead!');
|
||||||
end;
|
end;
|
||||||
@ -1834,15 +1839,6 @@ begin
|
|||||||
|
|
||||||
csSTATUSBAR :
|
csSTATUSBAR :
|
||||||
begin
|
begin
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*******gtk_status_bar********');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
Writeln('*****************************');
|
|
||||||
P := gtk_statusbar_new();
|
P := gtk_statusbar_new();
|
||||||
Assert(False, 'Trace:In CreateComponent --StatusBar');
|
Assert(False, 'Trace:In CreateComponent --StatusBar');
|
||||||
end;
|
end;
|
||||||
@ -2697,8 +2693,7 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.12 2000/12/29 18:33:54 lazarus
|
Revision 1.13 2000/12/29 19:20:27 lazarus
|
||||||
TStatusBar's create and destroy were not set to override TWinControls so they were never called.
|
|
||||||
Shane
|
Shane
|
||||||
|
|
||||||
Revision 1.11 2000/12/22 19:55:38 lazarus
|
Revision 1.11 2000/12/22 19:55:38 lazarus
|
||||||
|
Loading…
Reference in New Issue
Block a user