Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Input box resize limit gone.

Input box resize limit gone.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Wed 25 Jul 2007 05:38 PM (UTC)
Message
The input box used to have a minimum (one-line) height you could set it to, but this is now gone, so when I resize it downwards it becomes as small as I want, taking up half a line or whatever. This also means that the textboxes between worlds are different heights, since setting it by hand isn't very accurate.

Why was this removed? Is this a bug?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 25 Jul 2007 05:50 PM (UTC)
Message
Yeah I noticed too, somewhat annoying.

If this isn't a bug, could we get a new feature where you double-click the drag-bar which makes it resize to one line sized?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #2 on Wed 25 Jul 2007 06:42 PM (UTC)
Message
I personally like this feature. I completely remove the command box from the world that I dump channels into so that it's just a display. Having a way to set the height, especially with a selection of how many lines, and lock it in would be nice though, since I frequently manage to accidentally click on the bar and drag it around in my main world, and it's a pain getting it back to exactly two lines tall.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #3 on Wed 25 Jul 2007 09:22 PM (UTC)
Message
Maybe it could "snap" to 0, 1, 2, etc lines...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 25 Jul 2007 09:35 PM (UTC)
Message
If you want to specify it precisely, you can edit the Registry before you open the world up:


HKEY_CURRENT_USER\Software\Gammon Software Solutions\MUSHclient\WORLDNAME\Bottom Height


The default seems to be around 27, which is about 2 lines. I made it 13, and it seemed to just fit my 12-point FixedSys command line.

I'm not sure how easy the "snap to" idea would be, I can take a look at that later.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #5 on Wed 25 Jul 2007 09:37 PM (UTC)
Message
This is not a bug. It was implemented in version 3.83, see point 10:

http://www.gammon.com.au/scripts/showrelnote.php?version=3.83&productid=0

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 25 Jul 2007 09:42 PM (UTC)
Message
I know that fiddling with the Registry is not recommended, but if you take these lines and turn them into a (text) file:


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Gammon Software Solutions\MUSHclient\WORLD-NAME]
"Bottom Height"=dword:00000013



Replace "WORLD-NAME" by the world's name, save as "fix_command_height.reg" and then double-click it, it should fix up the command height for your world.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #7 on Wed 25 Jul 2007 09:43 PM (UTC)
Message
Doing this once per world is tedious, though. Could we have a global option, or the snapping thing?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #8 on Thu 26 Jul 2007 12:48 AM (UTC)
Message
Version 4.16, now released, has the snap-to thing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Sun 02 Mar 2008 06:23 AM (UTC)
Message
Quote:
If you hold down the Ctrl key whilst resizing the command window, it will now snap to the nearest whole number of lines.

What does it mean by "nearest"?

If I ctrl-click to size it at 1 line, move it down ever so slightly then ctrl-click again... it resizes to 0 lines instead of 1 (even though 1 was the closest/nearest size).

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #10 on Sun 02 Mar 2008 06:57 AM (UTC)

Amended on Sun 02 Mar 2008 06:58 AM (UTC) by Nick Gammon

Message
Well, this the relevant code (MySplitterWnd.cpp), note the comment "hideous" near the start:

/////////////////////////////////////////////////////////////////////////////
// CMySplitterWnd message handlers

void CMySplitterWnd::OnLButtonUp(UINT nFlags, CPoint point) 
{
  CSplitterWnd::OnLButtonUp(nFlags, point);

  // this hideous code is so that we know when the user has resized the
  // input pane, so we don't snap the size back to what it was
  if (m_pDoc)
    {
    int cyCur,
        cyMin;
    GetRowInfo (COMMAND_PANE, cyCur, cyMin);

    // snap to boundary stuff (version 4.16)
    if (((GetKeyState (VK_LCONTROL) & 0x8000) != 0 ||
        (GetKeyState (VK_RCONTROL) & 0x8000) != 0) && m_pDoc->m_input_font)
      {
      CDC dc;

      dc.CreateCompatibleDC (NULL);
      dc.SelectObject (m_pDoc->m_input_font);

      TEXTMETRIC tm;
      dc.GetTextMetrics(&tm);

      // need to know height of entire font (eg. 12 point FixedSys is 15)
      int m_iLineHeight = tm.tmHeight; 

      const int iFudge = 4;   // trial and error stuff, if anyone has a better idea let me know

      double fLines = (cyCur - iFudge) / m_iLineHeight;
      int iLines = floor (fLines + 0.5);   // round to nearest number of lines
      if (iLines)   
        cyCur =  m_iLineHeight * iLines + iFudge;  // calculate desired height for those lines
      else
        cyCur = 0;  // zero lines is still zero
      } // end of ctrl key held down

    if (!(m_pDoc->m_mush_name.IsEmpty ()))
      App.WriteProfileInt(m_pDoc->m_mush_name, "Bottom Height", cyCur);
//    TRACE1 ("Bottom height (saved) = %i\n", cyCur);

    if (m_pDoc->m_pActiveCommandView)
      m_pDoc->m_pActiveCommandView->m_owner_frame->FixUpSplitterBar ();
    else if (m_pDoc->m_pActiveOutputView)
      m_pDoc->m_pActiveOutputView->m_owner_frame->FixUpSplitterBar ();

	  }

}



This line should be doing it:


int iLines = floor (fLines + 0.5); // round to nearest number of lines


That adds half a line and then goes to the lower integer, that should technically be "nearest".

However if you can see a bug please let me know.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #11 on Mon 03 Mar 2008 03:42 AM (UTC)
Message
I confirm it seems to snap "down" rather than to nearest, however that code is shonky anyway. Maybe iFudge needs to be something other than 4?

It isn't a huge deal, just move the line to above where you want it and let go.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #12 on Mon 03 Mar 2008 03:55 AM (UTC)
Message
Quote:
It isn't a huge deal, just move the line to above where you want it and let go.

Except I can never tell what one line looks like, and I end up getting it too small (where it resizes it to 0 lines and I have to eyeball it once again without knowing what my last attempt was).

I was getting the source to debug this, but I haven't installed bzr yet.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #13 on Mon 03 Mar 2008 03:58 AM (UTC)
Message
The source for version 4.19 is here:

http://www.gammon.com.au/files/mushclient/src/mushclient_4.19_src.zip

That part hasn't changed since then.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,061 posts)  Bio   Forum Administrator
Date Reply #14 on Mon 03 Mar 2008 04:03 AM (UTC)
Message
Quote:

Except I can never tell what one line looks like, and I end up getting it too small ...


Type two lines of test text (using Ctrl+Enter to start the new line), resize without holding Ctrl, to get an approximation. Once the second line disappears you know you are somewhere over one line height but less than two lines height.

Then just Ctrl+Click the bar (without attempting to move it), and it will snap down to eliminate the useless white space.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


37,987 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.