Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-18 Thread fredvs
> AFAIK heaptrace can not work with cmem. 

Aaargh, indeed, with cmem and using float 32 resolution:

Heap dump by heaptrc unit
0 memory blocks allocated : 0/0
0 memory blocks freed : 0/0
0 unfreed memory blocks : 0
True heap size : 0
True free heap : 0

Here without cmem and float 32 resolution:

Marked memory at $7FD6E9CD80D0 invalid
Wrong signature $F11E8A3B instead of C4C4C11E
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server
":0.0"
  after 2539 requests (2538 known processed) with 0 events remaining.

And here  without cmem and integer 32/16 resolution:

Heap dump by heaptrc unit
6964 memory blocks allocated : 3952422/3965960
6964 memory blocks freed : 3952422/3965960
0 unfreed memory blocks : 0
True heap size : 1179648
True free heap : 1179648

...

How to debug that, if somebody has a idea, he is welcome to share it ;-)

Thanks.

Fre;D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread Martin Schreiber
On Sunday 17 September 2017 19:59:52 fredvs wrote:
> > A hint: the program crashes if compiled with -gh (heaptrace) there seems
> > to
>
> be a memory error somewhere.
>
> Yeeep, there is a solution:
>
> --->
>
> program strumpract;
> uses
>  cmem, ...
>
> It solves everything, no memory errors, nor memory leaks.
> Same for all uos examples.
>
I don't think this is a solution, it simply disables the extra memory check 
heaptrace does.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread fredvs
> A hint: the program crashes if compiled with -gh (heaptrace) there seems to
be a memory error somewhere. 

Yeeep, there is a solution:

--->

program strumpract;
uses
 cmem, ...

It solves everything, no memory errors, nor memory leaks.
Same for all uos examples.

Good to know.

;-)

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread fredvs
> A hint: the program crashes if compiled with -gh (heaptrace) there seems to
be a memory error somewhere.

Huh, I think I get the guilty.  But if it is true, there is a **BIG**
problem with fpc 3.0.3.

I did just check demos of uos.  Now, **ALL* demos (console, fpGUI, MSE, LCL)
that use float resolution --> crash + memory leak when using -ghl.

If resolution is integer (16 or 32) no crash.

Maybe you may test by yourself.

Take the example SimplePlayer_MSE.prj from  https://github.com/fredvs/uos.

Compile it with -ghl and run it.  By default, the resolution is float 32.
--> it will crash + memory leak.
Now, reload the program but choose integer 16 or 32 bit resolution --> no
crash, no memory leak.

I insist to say that with previous fpc version, using  float 32 resolution
was ok.

Aaaargh, this is a **VERY BIG** problem.

Fre;D





--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread fredvs




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread fredvs
Hello Martin.

Many thanks for your tips and patch.

I will study it deeply.

> A hint: the program crashes if compiled with -gh (heaptrace) there seems
> to be a memory error somewhere. 

Yep, I have seen it yesterday.  I have to check it.

Other thing.  I am busy with the file-list window (for dj).  But I have
problems with tdirdropdownedit and statfile.
If a statfile is assigned, when loading the application, the list of the
combobox is show (like when selecting).

Even if the form is hidden, the list of the combobox appears in the midle of
nowhere.

I cannot give a printscreen because thelist of combobox disappears when
doing a printscreen.

Thanks.

Fre;D

 






--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] strumpract (was MSE and docking).

2017-09-17 Thread Martin Schreiber


On 09/16/2017 02:47 PM, fredvs wrote:
> 
> With a tabed form, when other tabs are active, it is not possible to select
> a other tab.
> 
> See video:
> msetabprob.mp4
>   
> 
That could be a problem:
"
procedure tdrumsfo.ontimertick(const Sender: TObject);
[...]
 application.lock();
label2.visible := true;

if (posi = 1) or (posi = 9) then
begin
 label3.visible := true;
 label4.visible := false;
end else
if (posi = 5) or (posi = 13) then
begin
 label3.visible := false;
 label4.visible := true;
end;
"
The parent of the labels is a tdockpanel which triggers a layout
recalculation of the whole docking stack because hiding/showing of a
widget can change the client size of the parentwidget.
I suggest to replace tdockpanel4 by a tgroupbox. I see more tdockpanels
in the application where a tgroupbox is more appropriate.

BTW, application.lock()/unlock() is not necessary in ttimer.onexecute
events, they run in main thread context.

Another problem is the label font setting
"
if (posi = 5) then
begin
alab2[1].font.color := cl_white;

alab2[0].font.color := cl_black;
alab2[2].font.color := cl_black;
alab2[3].font.color := cl_black;
[...]
"
some of the labels have font =  which means that you set the
properties of the parent or default font which again triggers layout
calculation.
"
 if (posi = 1) or (posi = 9) then
@@ -754,6 +754,7 @@ var
 ordir : string;
 spcx, spcy, posx, posy, ax  : integer;
 lib1, lib2, lib3, lib4 : string;
+ i1: int32;
 begin
 // visible := false;

@@ -846,6 +847,9 @@ begin
  alab2[1] := tlabel2;
  alab2[2] := tlabel3;
  alab2[3] := tlabel4;
+ for i1:= 0 to high(alab2) do begin
+  alab2[i1].createfont();
+ end;

"
fixes the problem.
After above changes tab selection with running drums works for me, see
attachment.

A hint: the program crashes if compiled with -gh (heaptrace) there seems
to be a memory error somewhere.

Martin


tabselect.patch.7z
Description: application/7z-compressed
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk