pallettes and Bricscad V12

Started by Emiliano, August 17, 2012, 06:57:07 AM

Previous topic - Next topic

Emiliano

Hello everyone,
can anyone confirm that Bricscad V12.2.14 events "OnMouseEntered" and "Size" are in conflict between them?

It seems to me that when I enter into the palettes first initiated the event is "Size" maybe because I approach the edge of the palettes, and then the event "OnMouseEntered".  :o

While in AutoCAD work properly: only the event starts "OnMouseEntered".

It's a bug or Bricscad OpenDCL?

owenwengerd

I tested in the latest build of OpenDCL 7 on Bricscad 12.2.5 and it only fires OnSize when the palette changes size, as expected. Perhaps something has changed in the more recent build of Bricscad.
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

Unless the palette is set to autohide I only get the OnMouseEntered event with BC 12.2.14 + ODCL 7.0.06. Tested with a docked and undocked palette. Apart from autohide it is also possible that your code triggers an OnSize event.

Emiliano

I did not understand, maybe for my bad English ...  :-[

I tried with BC 02.12.14 + ODCL 7.0.04 and the result is what you see in the video.

With ODCL 7.0.06 working properly?

I'm not very concerned about the conflict of events, but only for the fact that the button that I put into the palettes is not scaled properly when I resize the palettes than the minimum size set.

roy_043

Maybe the attached picture will help:
1. Palette set to autohide.
2. Palette not set to autohide.

Quote from: Emiliano on August 18, 2012, 02:43:30 AM
in the video.
What video?

Quote from: Emiliano on August 18, 2012, 02:43:30 AM
when I resize the palettes
I don't understand: are you resizing or not?

Emiliano

I apologize,
I forgot to attach the file lisp + odcl and video for you to understand the problem.
I now attach.

owenwengerd

I'm having trouble understanding the problem. Maybe it would help eliminate external influences and make your sample less confusing if you change your palette to contain only a single listbox, then change your event handlers to add a line to the list box each time they are called.
Owen Wengerd (Outside The Box) / ManuSoft

Emiliano

The code I posted is very simple.
With video understanding of the problem is very simple.
In Autocad works well, but not in Bricscad.
So, I think it is easy to understand that there is a bug in Bricscad or OpenDCL

What do not you understand now?

owenwengerd

The code you posted is complicated and confusing because it introduces several unrelated elements, and it's not clear whether those elements have any bearing on the problem. For example, your OnSize event handler resizes the button. You don't that resizing the button has any effect on the problem, so I assume it is irrelevant. Your OnMouseEntered event handler prints text to the command line. You don't say whether this printing has any effect on the problem. Therefore, I assume it is irrelevant and has no bearing on the problem.

If those elements are in fact irrelevant, they should not be in your sample. Taking the steps I outlined will help you determine definitively whether they are relevant. Defending the quality of your sample is not helpful. No matter how good it is, it is not good enough until it is able to communicate your problem to me.
Owen Wengerd (Outside The Box) / ManuSoft

Emiliano

I hope I can explain my problem with this post, or let me know what is not clear.
I have to do exactly what you see in the video:

1. With the event OnSize want to make sure that all controls inside the palettes are adapted to its size
2. The minimum width of the pallettes must be 336

Unfortunately, in Bricscad, when I resize the palettes with the mouse over the minimum width happens what you see in the video: the button becomes much smaller and does not respect the rule "button width = palettes width  - 16"

3. The event OnMouseEntered becomes relevant after replacing (princ "\ nenter") with (alert "enter"): in this case, in Bricscad becomes almost impossible to resize the palettes in AutoCAD is ok.

Thanks in advance for your answers.

owenwengerd

You describe two different problems, and it seems neither problem actually has anything directly to do with the order of OnSize and OnMousEntered.

Problem #1: Minimum palette size set in .odcl is not honored.

This is likely caused by bugs in the implementation of palettes in Bricscad, but I will check this again to see if anything can be done to work around the problem. For now, I'm afraid you are stuck with the problem.

Problem #2: Displaying an (alert) dialog during OnMouseEntered makes it difficult to resize a palette.

If your OnMouseEntered event causes the input focus to change away from the palette as soon as the mouse enters, you should expect this consequence. This is why I asked you to display events in a listbox: to ensure that your diagnostic code does not change its subject. Even so, if you had posted your sample code with (alert) instead of (princ), your mistake would have been immediately obvious and we could have avoided this long discussion.


Finally, instead of resizing controls in OnSize, it would be more efficient to set them to resize automatically with the form. For example, you can set the UseRightFromRight property of your button to 1 so that its width changes automatically.
Owen Wengerd (Outside The Box) / ManuSoft

Emiliano

Quote from: owenwengerd on August 20, 2012, 10:10:14 AM
You describe two different problems, and it seems neither problem actually has anything directly to do with the order of OnSize and OnMousEntered.

Problem #1: Minimum palette size set in .odcl is not honored.

This is likely caused by bugs in the implementation of palettes in Bricscad, but I will check this again to see if anything can be done to work around the problem. For now, I'm afraid you are stuck with the problem.

I've already entered a support request to Bricsys, they said they are investigating to solve the problem.

Quote from: owenwengerd on August 20, 2012, 10:10:14 AM
Problem #2: Displaying an (alert) dialog during OnMouseEntered makes it difficult to resize a palette.

If your OnMouseEntered event causes the input focus to change away from the palette as soon as the mouse enters, you should expect this consequence. This is why I asked you to display events in a listbox: to ensure that your diagnostic code does not change its subject. Even so, if you had posted your sample code with (alert) instead of (princ), your mistake would have been immediately obvious and we could have avoided this long discussion.

I had just entered the alert because this would have helped prevent the verification of the first problem.
My real problem is in fact the correct sizing of controls.
In my application there is also the event "OnMouseEntered", but this is not a problem as long as there is an "alert" on the inside.
During my tests carried out to check what was the problem I added an alert and I noticed that too minor error.
It was not my intention to dwell too this discussion.
So if you agree, now I want to focus in finding a solution to the first problem.

Quote from: owenwengerd on August 20, 2012, 10:10:14 AM
Finally, instead of resizing controls in OnSize, it would be more efficient to set them to resize automatically with the form. For example, you can set the UseRightFromRight property of your button to 1 so that its width changes automatically.

This is great because it greatly simplifies my code.
Too bad that in Bricscad has the same problem of my solution   :'(
Probably I will have to wait for the solution of Bricys.
Anyway thanks for the help!

roy_043

I can confirm that the UseRightFromRight property does not solve this issue.

In a simple project I have a palette and, for comparison, a modal dialog. Both have a min. width of 80. Both have two controls with UseRightFromRight set to 1.

The palette can be resize to a width smaller than 80:
Docked palette:
Code (autolisp) Select
(dcl_Control_GetWidth Test_Resize_Palette1) ; => 40
After undocking the same palette:
Code (autolisp) Select
(dcl_Control_GetWidth Test_Resize_Palette1) ; => 60

Using this code on a palette does not work properly:
Code (autolisp) Select
(dcl_Control_SetWidth Test_Resize_Palette1 160)
The controls are resized but the palette is not, resulting in a clipped effect.

owenwengerd

It's helpful to consider that the palette form is hosted inside a "dockable container" (which can actually contain multiple palettes or other forms). When you resize a docked palette, you resize the *container*. The control resizing is working fine; the form size is not remaining synchronized with the container in this case. I'm not certain that the problem is in Bricscad, but the odds are pretty good since their palettes are still a work in progress.
Owen Wengerd (Outside The Box) / ManuSoft

Emiliano

Quote from: owenwengerd on August 21, 2012, 08:18:39 AM
It's helpful to consider that the palette form is hosted inside a "dockable container" (which can actually contain multiple palettes or other forms). When you resize a docked palette, you resize the *container*. The control resizing is working fine; the form size is not remaining synchronized with the container in this case. I'm not certain that the problem is in Bricscad, but the odds are pretty good since their palettes are still a work in progress.

I'm not an expert, but whereas in AutoCAD works correctly, I believe that the problem is side Bricscad.

I await the response of Bricsys and let you know.
If necessary, keep me informed if you find a solution.

thanks