Recent

Author Topic: Merged Form Designer?  (Read 118834 times)

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #30 on: July 09, 2012, 03:01:19 pm »
I think object-inspector should on the leftside.
Object, projekt and code-inspector could docked on the same place.

Done! rs... I created a screen options in tools menu ; There you can select the left or right ;)

Obs: Update your SVN

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Merged Form Designer?
« Reply #31 on: July 09, 2012, 03:48:48 pm »
Quote
Well .. I'm working on the project here; Any suggestions you have to work with you or any improvement, I can pass here to update the SVN
Since the code is in my office's computer, I can't attach here. However, the addition is very trivial (on r26, I haven't seen the r28):

1. Add package called ide as dependency (codeexplorer unit is part of this package)
2. In klazdesktop.pas: Add codeexplorer to the uses clausePut another panel (say pnCodeExplorer) and splitter, on the left
3. Add TKZLazDesktopInterface.IsCodeExplorerView which is as simple as:
Code: [Select]
function TKZLazDesktopInterface.IsCodeExplorerView(fm: TCustomForm): boolean;
begin
  Result := (fm.ClassName = 'TCodeExplorerView');
end;
4. Add:
Code: [Select]
function TKZLazDesktopInterface.CodeExplorerView: TCodeExplorerView;
begin
  Result := TCodeExplorerView(Screen.FindForm('CodeExplorerView'));
end;
5. Last but not least, in TKZLazDesktopInterface.ScreenActiveFormChange, add:
Code: [Select]
if IsCodeExplorerView(Screen.ActiveForm) then
    begin
      SetupLazForm(Screen.ActiveForm, pnCodeExplorer);
    end;
Now I get code explorer on the left ;)
Please adapt the code for r28

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #32 on: July 09, 2012, 04:30:23 pm »
Quote
Well .. I'm working on the project here; Any suggestions you have to work with you or any improvement, I can pass here to update the SVN
Since the code is in my office's computer, I can't attach here. However, the addition is very trivial (on r26, I haven't seen the r28):

1. Add package called ide as dependency (codeexplorer unit is part of this package)
2. In klazdesktop.pas: Add codeexplorer to the uses clausePut another panel (say pnCodeExplorer) and splitter, on the left
3. Add TKZLazDesktopInterface.IsCodeExplorerView which is as simple as:
Code: [Select]
function TKZLazDesktopInterface.IsCodeExplorerView(fm: TCustomForm): boolean;
begin
  Result := (fm.ClassName = 'TCodeExplorerView');
end;
4. Add:
Code: [Select]
function TKZLazDesktopInterface.CodeExplorerView: TCodeExplorerView;
begin
  Result := TCodeExplorerView(Screen.FindForm('CodeExplorerView'));
end;
5. Last but not least, in TKZLazDesktopInterface.ScreenActiveFormChange, add:
Code: [Select]
if IsCodeExplorerView(Screen.ActiveForm) then
    begin
      SetupLazForm(Screen.ActiveForm, pnCodeExplorer);
    end;
Now I get code explorer on the left ;)
Please adapt the code for r28

Ok, I'm working on it ... One detail about the 'ide' package is that I've thought about using it, but when tested in a Lazarus installed on a debian, I discovered that the package IDE is not public to compile (in the linux debian), and for security, I'm avoiding the ide, to maintain compatibility with most people ...

SunyD

  • Guest
Re: Merged Form Designer?
« Reply #33 on: July 09, 2012, 05:14:44 pm »
I think object-inspector should on the leftside.
Object, projekt and code-inspector could docked on the same place.

Done! rs... I created a screen options in tools menu ; There you can select the left or right ;)

Obs: Update your SVN

yesterday I changed selft your code and placed it left :)
I check your changes now.
Of course you can take my little changes and put it in your code, always.

SunyD

  • Guest
Re: Merged Form Designer?
« Reply #34 on: July 09, 2012, 05:29:18 pm »
Maybe it's better to change Lazarus source and put designer in die Sourceeditor:
One Button on Statusbar to switch (one hidden other visible) between SynEdit and formdesigner.

For the other things is AnchorDock-Package very good.

wp

  • Hero Member
  • *****
  • Posts: 13324
Re: Merged Form Designer?
« Reply #35 on: July 09, 2012, 06:22:35 pm »
Very nice! F12, however, is not working from form designer to editor - it is working the other way, though.
(r28).

SunyD

  • Guest
Re: Merged Form Designer?
« Reply #36 on: July 09, 2012, 06:33:53 pm »
I updated from svn it's great.

Raphael, yesterday i forget to post 1 code line to avoid useless space under toolbars here is it. If anybody want it:
Code: [Select]
procedure TKZLazDesktopInterface.SetupDefaultBars;
......
      //End ... Suny: Added from me

      {Code from Raphael
      TToolBar(FindChildControl('tbViewDebug')).Align := alLeft;
      TToolBar(FindChildControl('tbStandard')).Align := alLeft;
      }

     //only this line below is new:
      pnMenu.Height:=aToolBarStd.Height+2;   //Added from Suny;
     //end of : only this line below is new

      Align := alClient;
      Parent := pnMenu;   

Screenshot:

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Merged Form Designer?
« Reply #37 on: July 09, 2012, 06:57:05 pm »
I just remembered an idea. It's better to show what's relevant to current context, so if the active tab is source editor, display code explorer, if the active tab is design editor, display object inspector. That way a lot of screen spaces could be saved.

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #38 on: July 09, 2012, 07:05:56 pm »
I updated from svn it's great.

Raphael, yesterday i forget to post 1 code line to avoid useless space under toolbars here is it. If anybody want it:
Code: [Select]
procedure TKZLazDesktopInterface.SetupDefaultBars;
......
      //End ... Suny: Added from me

      {Code from Raphael
      TToolBar(FindChildControl('tbViewDebug')).Align := alLeft;
      TToolBar(FindChildControl('tbStandard')).Align := alLeft;
      }

     //only this line below is new:
      pnMenu.Height:=aToolBarStd.Height+2;   //Added from Suny;
     //end of : only this line below is new

      Align := alClient;
      Parent := pnMenu;   

Screenshot:

Added!

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #39 on: July 09, 2012, 07:08:45 pm »
I just remembered an idea. It's better to show what's relevant to current context, so if the active tab is source editor, display code explorer, if the active tab is design editor, display object inspector. That way a lot of screen spaces could be saved.

I'm still doing some tests with the shortcut keys, but I consider it because you're right ... The keys should work as closely as possible to the original IDE ;)

SunyD

  • Guest
Re: Merged Form Designer?
« Reply #40 on: July 09, 2012, 07:12:46 pm »
I just remembered an idea. It's better to show what's relevant to current context, so if the active tab is source editor, display code explorer, if the active tab is design editor, display object inspector. That way a lot of screen spaces could be saved.
This was also my idea, i was looking how to make it.
Yet my code explorer ist gone, it is unvisible# i must find it.

Another small bug is, you have more sources with forms opened, if you change formdesigner tab than form designer shows always the last opened form not the actually from source-editor. You have to press f12 or klick [change unit/form]-Button.

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #41 on: July 09, 2012, 07:44:25 pm »
I just remembered an idea. It's better to show what's relevant to current context, so if the active tab is source editor, display code explorer, if the active tab is design editor, display object inspector. That way a lot of screen spaces could be saved.
This was also my idea, i was looking how to make it.
Yet my code explorer ist gone, it is unvisible# i must find it.

Another small bug is, you have more sources with forms opened, if you change formdesigner tab than form designer shows always the last opened form not the actually from source-editor. You have to press f12 or klick [change unit/form]-Button.

I was making some changes here, and now I work with shortcut keys ...

The changes I made (released now) are:
A panel for the code explorer;
A 'component find' in the components palette (very cool)

I'll start tinkering with the shortcuts now  ;)
« Last Edit: July 09, 2012, 07:54:15 pm by RaphaelZ »

SunyD

  • Guest
Re: Merged Form Designer?
« Reply #42 on: July 10, 2012, 01:50:53 am »
I put code-explorer and object-inspector in PageCtrl and it will automatically bring to front what you selected. See screenshot above.
If you want it take to your code than here is what I made:
1. In Formular I created Pacecontrol (pcInspectors) with 2 tabsheets(tsObjInspector, tsCodeExplorer) and placed it where pnObjectInspector was.
2. I placed pnObjectInspector in to  tsObjInspector with aligned:=alCLient property
3. I placed pnCodeExplorer in to  tsCodeExplorer with aligned:=alCLient property.
4. Splitter1 between pnCodeExplorer and source-editor deleted, because it doesn't needed more.

5. In source-file:
Code: [Select]


procedure TKZLazDesktopInterface.ScreenActiveFormChange(Sender: TObject);
.......
    if IsSourceEditor(Screen.ActiveForm) then
    begin
      SetupLazForm(Screen.ActiveForm, pnCodeEditor);
      pcCorpo.ActivePageIndex := 0;
LINE ~870:
      pcInspectors.ActivePage:=tsCodeExplorer;//suny, added for pcInspectors

      if SourceNotebook.OnActivate <> @SourceNotebookActive then
...


if IsCodeExplorerView(Screen.ActiveForm) then
    begin
      //spCodeExplorer.AnchorSplitter(akRight, pnCodeExplorer);
      pnCodeExplorer.Visible := True;
LINE ~935
      //suny for pcInspectors deleted: Splitter1.Visible := True;
....

      end;

      pcCorpo.ActivePage := tsFormEditor;
LINE ~1030
      pcInspectors.ActivePage:=tsObjInspector;//suny, added for pcInspectors
    end;

............................

procedure TKZLazDesktopInterface.UpdateFromOptions;
begin

  if LoadCFG('Layout', 'ObjectInspectorPanel', 'right') = 'left' then
  begin

LINE ~1398:
    pcInspectors.Align := alLeft; //suny, changed for pcInspectors, old was: pnObjectInspector.Align := alLeft;
    spObjectInspector.Align := alLeft; //suny, added for pcInspectors, splitter was not aligned
     spObjectInspector.Left:=pcInspectors.Left+pcInspectors.Width+2; //suny, added for pcInspectors, splitter was not aligned


    //spObjectInspector.AnchorSplitter(akRight, pnCorpo);
    pnFindComponent.Align := alLeft;
  end
  else
  begin
LINE ~1498:
    pcInspectors.Align := alRight; //suny, changed for pcInspectors, old was: pnObjectInspector.Align := alRight;
    spObjectInspector.Align := alRight; //suny, added for pcInspectors, splitter was not aligned
     spObjectInspector.Left:=pcInspectors.Left-spObjectInspector.Width-2; //suny, added for pcInspectors, splitter was not aligned

    //spObjectInspector.AnchorSplitter(akLeft, pnCorpo);
    pnFindComponent.Align := alRight;
  end;




Also I uploaded 2 changed files, if you need it.

RaphaelZ if you take my code parts to your svn, you can remove all my comments. I make it to know what i changed.


Screenshots:
« Last Edit: July 10, 2012, 01:52:39 am by SunyD »

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #43 on: July 10, 2012, 01:42:05 pm »
I put code-explorer and object-inspector in PageCtrl and it will automatically bring to front what you selected. See screenshot above.
If you want it take to your code than here is what I made:
1. In Formular I created Pacecontrol (pcInspectors) with 2 tabsheets(tsObjInspector, tsCodeExplorer) and placed it where pnObjectInspector was.
2. I placed pnObjectInspector in to  tsObjInspector with aligned:=alCLient property
3. I placed pnCodeExplorer in to  tsCodeExplorer with aligned:=alCLient property.
4. Splitter1 between pnCodeExplorer and source-editor deleted, because it doesn't needed more.

Okay .. You gave a great idea, I'll change here to be equal to what you did, but I will also create more options for where to put things  ;)

RaphaelZ

  • Jr. Member
  • **
  • Posts: 64
Re: Merged Form Designer?
« Reply #44 on: July 10, 2012, 07:17:37 pm »
I put code-explorer and object-inspector in PageCtrl and it will automatically bring to front what you selected. See screenshot above.
If you want it take to your code than here is what I made:
1. In Formular I created Pacecontrol (pcInspectors) with 2 tabsheets(tsObjInspector, tsCodeExplorer) and placed it where pnObjectInspector was.
2. I placed pnObjectInspector in to  tsObjInspector with aligned:=alCLient property
3. I placed pnCodeExplorer in to  tsCodeExplorer with aligned:=alCLient property.
4. Splitter1 between pnCodeExplorer and source-editor deleted, because it doesn't needed more.

Okay .. You gave a great idea, I'll change here to be equal to what you did, but I will also create more options for where to put things  ;)

Here I am again ... I released a new option in SVN (on 'Desktop KZ - Options' menu) to select where you want the code explorer, I hope you enjoyed!

 

TinyPortal © 2005-2018