RICHEDITBOX in Panel-Window (Virtual Height)

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 1752
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 232 times
Been thanked: 45 times
Contact:

Re: RICHEDITBOX in Panel-Window (Virtual Height)

Post by serge_girard » Mon May 15, 2017 2:14 pm

In minigui it gives the same bizar behaviour...

Serge

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Tue May 16, 2017 9:58 am

serge_girard wrote:
Mon May 15, 2017 2:14 pm
In minigui it gives the same bizar behaviour...

Serge
Hi Serge,

seems to be a bug. I tried several versions:

Version A:
1. Main-Window
2. Second window as modal-window-virtual-height (toolbox is not possible here). With controls before RichEditBox and behind. This version works perfect. I enter the RichEditBox always on the top.

Version B:
1. Main Window
2. Second window as modal-window-vitual-height calling a third window modal or panel. This version gets wrong. When I enter the RichEditBox the window moves up and I see the bottom. For writing, I need the slider.

I hope, one of the masters can help me. It would be great.

Regards Karl
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Fri Jun 02, 2017 12:08 pm

Hi to all,

I found out, that this strange behaviour has nothing to do with a PANELTYPE window. When I jump from one TextBox to the next and finally come into the RichEditBox the cursor stands at the beginning of the Box. But the window turns down at the end of the Box. This has to do with "SET AUTOSCROLL ON". If I set it to OFF, the jumping of the window doesn´t happen. But this is a drawback, because now I need the vertical-slider to come to the controls before and behind my RichEditBox.

It´s a very annoying behaviour (Serge named it "bizarre"). If any of you, my dear friends, could fix this bug, I would be very much obliged. In the appendix I once again add a simple example.

Karl
Attachments
Set_Autoscroll.zip
(1.48 MiB) Downloaded 8 times
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

edk
Posts: 117
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 33 times
Been thanked: 61 times

Post by edk » Fri Jun 02, 2017 1:37 pm

Hi Karl.
You can "force" the scrolling position:

Code: Select all

@ 370,72  RICHEDITBOX Edit_1 OF Form_3 ;
          WIDTH 695 ;
          HEIGHT 460 ;
          VALUE '' ;
          FONT 'Times New Roman' SIZE 12 ;
          ON GOTFOCUS _HMG_PRINTER_SETVSCROLLVALUE( GetFormHandle ( 'Form_3' ) , 370 ) ;
          ON LOSTFOCUS nil ;          
          NOHSCROLL
where: _HMG_PRINTER_SETVSCROLLVALUE( GetFormHandle ( 'Form_3' ) , 370 ) ;
'Form_3' - is current window (form) name
370 - is position of v scroll, in this case the RichEditBox nRow

Edward.
Attachments
Set_Autoscroll.7z
(965.25 KiB) Downloaded 10 times

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Fri Jun 02, 2017 3:11 pm

Dear EDK,

Once again you could help me with your profound knowledge. I appreciate that very much and thanks a lot. But there is still a very little hair in the soup. When the RichEditBox is loaded with text and I do not enter it over TAB or ENTER from the former controls. I enter it with a mouseclick because I cannot wait.... The cursor is at the start of the Box but a lot of text is marked. I´ll add this in my sample and send it.

Karl
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Fri Jun 02, 2017 4:42 pm

Hi Edward,
sorry, I didn´t see your first name in your last post. Now the new sample in the attachment. Unfortunately the text in the RichEditBox is in German. I think this doesn´t matter.
Karl
Attachments
RichEditBox_2.zip
(1.48 MiB) Downloaded 14 times
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

edk
Posts: 117
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 33 times
Been thanked: 61 times

Post by edk » Fri Jun 02, 2017 5:54 pm

Hi Karl, I will check reported issue on Monday, for the weekend I am without PC access. 8-)
Regards, Edward.

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Sat Jun 03, 2017 4:42 am

Good idea, Edward. Because of Pentecost it will take this time until Tuesday.
Karl
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

edk
Posts: 117
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 33 times
Been thanked: 61 times

Post by edk » Mon Jun 05, 2017 1:32 pm

Hi Karl.
Solution without changing HMG sources, it may be (in a dirty way) execution of UnSelectAll after the time it takes to complete the event.

Code: Select all

FUNCTION changekey ()
ON KEY TAB OF Form_3 ACTION HMG_PRESSKEY(17, 9)
ON KEY ESCAPE OF Form_3 ACTION Form_3.Text_2.SETFOCUS
_HMG_PRINTER_SETVSCROLLVALUE(GetFormHandle('Form_3'), 350)
Millisec(50)
Form_3.Edit_1.UnSelectAll
Millisec(50)
RETURN Nil
Maybe that will solve your issue.

Edward.
Attachments
RichEditBox2.7z
(1.06 MiB) Downloaded 10 times

User avatar
Karl
Posts: 38
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Location: Germany
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Tue Jun 06, 2017 7:09 am

Good morning Edward,
I´m happy, problem solved. I changed Millisec into 10, because of the flickering of the RichEditBox. I thank you very much again. This is the reason why I love HMG so much. There is always someboody who can help me.
Have a good week.
Karl
WIN 7, WIN 10 64-bit, HMG 3.4.4, 32-bit

Post Reply