alexander-pick / MKMTool

MKMTool ist a helper application I wrote for tinkering around with optimization of sale processes on magiccardmarket.eu and the idea of automisation of some tasks most people wouldn’t be able to get done by pure manpower.
GNU Affero General Public License v3.0
65 stars 15 forks source link

Request: option to stop the auto scroll when updating #44

Open pepev12 opened 3 years ago

pepev12 commented 3 years ago

Hi, thanks for keeping this tool awesome, I would like to ask for a feature, that i think its easy and can be very helpfull; now when updating inventory, its very difficult to look how prices are adjusting because of the auto scroll in the main window. It the auto scroll were optional, with a checkbox for example, it could be much easy to check how the tool is working without having to wait for the full pass, Best regards,

tomasjanak commented 3 years ago

Yes please, I hate the way it is now. The best I could do is change the MainView.logBoxAppend method from this:

private void logBoxAppend(string text)
{
  logBox.AppendText(text);
}

to this:

private void logBoxAppend(string text)
{
  int cursorPosition = logBox.SelectionStart;
  int selectedLength = logBox.SelectionLength;
  logBox.AppendText(text);
  logBox.Select(cursorPosition, selectedLength);
  logBox.ScrollToCaret();
}

Which technically works, but the AppendText still changes the caret position and you can then see the flickering as the position change from the current, to bottom, to current again. logBox.Text += text; behaves the same way. If someone knows how to make the control not refresh between the two calls, that would be great.