View unanswered posts | View active topics



Reply to topic  [ 10 posts ] 
Toggle panel instead of show 
Author Message
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
Commands like menu->view->[Output panel, Project manager, etc] currently only show and focus associated panel.
I'm suggesting to remade its way of work to 2 states:
1) IF focus is not in panel THEN command shows panel (if hidden) and give focus to it.
2) ELSE IF associated panel shown and focused and its state is AutoHide in anyway THEN force minimize it back to button.
3) ELSE IF associated panel shown and focused THEN command hide panel immediately and move focus to document/previous panel.

Ways to implement:
Add to DockContent class method toggle(), and remade that menu commands to it, instead of show().
Remade show() method itself as deprecated and linked to toggle() for backward compatibility.

Where implemented:
Inelij IDEA

_________________
[url=http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8872]Interface: concept[/url]. My Little Plugins: [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=7807][FD3][FD4]MSVS style comments 0.2[/url], [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=8886][FD4]AutohideMenu[/url].


Last edited by garkin on Fri Aug 12, 2011 12:39 pm, edited 1 time in total.



Wed Aug 10, 2011 7:31 pm
Profile
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
How to minimize AutoHide'n panel instead of total hide (as autohide works on lose focus and timer)?
If u call .Hide() it disapers fully with button, need to keep its autohidden state, but minimize.

_________________
[url=http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8872]Interface: concept[/url]. My Little Plugins: [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=7807][FD3][FD4]MSVS style comments 0.2[/url], [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=8886][FD4]AutohideMenu[/url].


Fri Aug 12, 2011 12:36 pm
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 2792
Location: Finland
If i understand correctly you should set the focus to something else to make it get back to it's former state.


Fri Aug 12, 2011 12:49 pm
Profile WWW
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
Yeah, but that will not minimize it immediately, 0.5sec timer. Need way to force it to 0 sec.

_________________
[url=http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8872]Interface: concept[/url]. My Little Plugins: [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=7807][FD3][FD4]MSVS style comments 0.2[/url], [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=8886][FD4]AutohideMenu[/url].


Fri Aug 12, 2011 1:32 pm
Profile
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
Ok, so i got needed behavior by adding following chnages in each plugin panel code in PluginMain.cs:
Code:
-   ToolStripMenuItem viewItem = new ToolStripMenuItem(label, this.pluginImage, new EventHandler(this.OpenPanel));
+   ToolStripMenuItem viewItem = new ToolStripMenuItem(label, this.pluginImage, new EventHandler(this.TogglePanel));


Code:
-   /// <summary>
-   /// Opens the plugin panel if closed
-   /// </summary>
-   public void OpenPanel(Object sender, System.EventArgs e)
-   {
-      this.pluginPanel.Show();
-   }
+   /// <summary>
+   /// Toggles the plugin panel. Focus panel if it was not focused, else hide it or minimize for autohidden panels
+   /// </summary>
+   public void TogglePanel(Object sender, System.EventArgs e)
+   {
+      if (this.pluginPanel.IsActivated)
+      {
+         if (this.pluginPanel.Pane.IsAutoHide)
+         {
+            //force autohide
+            this.pluginPanel.DockPanel.ActiveAutoHideContent = null;
+         }
+         else
+         {
+            this.pluginPanel.Hide();
+         }
+      }
+      else
+      {
+         this.pluginPanel.Activate();
+      }
+   }


Other way - add this methods anyway to DockPanelSuite, but i believe it bad, cause DPS is external library and changes in it are undesirable.

_________________
[url=http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8872]Interface: concept[/url]. My Little Plugins: [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=7807][FD3][FD4]MSVS style comments 0.2[/url], [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=8886][FD4]AutohideMenu[/url].


Sat Oct 08, 2011 4:28 pm
Profile
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
It seems like Dock Panel Suite not updated for a while, perhaps it makes sense after all to begin making changes in it without dancing around.

_________________
[url=http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8872]Interface: concept[/url]. My Little Plugins: [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=7807][FD3][FD4]MSVS style comments 0.2[/url], [url=http://www.flashdevelop.org/community/viewtopic.php?f=4&t=8886][FD4]AutohideMenu[/url].


Sun Oct 09, 2011 3:40 pm
Profile
Member

Joined: Wed Jan 04, 2012 3:04 pm
Posts: 8
garkin, can you please guide me how can I apply your fix?

I didn't find any *.cs files under FlashDevelop folder. I need to make output panel to toggle.


Mon Feb 06, 2012 1:45 pm
Profile WWW
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
zulin wrote:
garkin, can you please guide me how can I apply your fix?

I didn't find any *.cs files under FlashDevelop folder. I need to make output panel to toggle.
This is not scripting. This is a changing of FlashDevelop source codes itself. You will need to recompile it after fix. And you will need a Visual Studio to do that.


Mon Feb 06, 2012 5:45 pm
Profile
Member

Joined: Wed Jan 04, 2012 3:04 pm
Posts: 8
garkin wrote:
This is a changing of FlashDevelop source codes itself. You will need to recompile it after fix. And you will need a Visual Studio to do that.


arghh ... that's kind of overkill for that simple feature :)
thanks anyway


Tue Feb 07, 2012 10:30 am
Profile WWW
Member

Joined: Mon Jan 04, 2010 12:36 pm
Posts: 45
Location: google translate slave
Yep, this is sad, but it cant be implemented by simple plugin or script. And this is a reason why it was suggested like a feature to implement in vanilla.


Tue Feb 07, 2012 12:13 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.