OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: krunch on March 02, 2011, 06:12:10 AM

Title: Short list of imperfections
Post by: krunch on March 02, 2011, 06:12:10 AM
Hello
I've found some new imperfections..
Regards


Not clean (ControlBar/Palette) : Opening an "undocked" ControlBar or Palette
Opening a ControlBar/Palette with coordinates seems to open it first as docked, before positioning it in the specified position (can see it for a split second)

> Please open "cropped!.odcl" and keep an eye on the left side :
(defun c:go ()
  (command "OPENDCL")
  (dcl_Project_Load "cropped!" T)
  (dcl_Form_Show cropped!_Form1 '10 10) ; ControlBar
  (dcl_Form_Show cropped!_Form2 '10 10) ; Palette
  (princ)
)


Display problem (ControlBar) : Resizing a ControlBar (AllowResizing=T) crops controls

> Please see text in the ControlBar (Form1) in "cropped!.odcl"


Incohérence (ControlBar) : resizing handles appear while Resizing=nil
Resizing-handles (horizontal/vertical double arrows) re-appear after the ControlBar has been moved, or its docked state changed. Handles are displayed while resizing isn't possible

> Please change AllowResizing (to nil) in cropped!_Form1, save, re-open, Move the ControlBar and place the cursor on one of the borders


Update problem (ControlBar/Palette) : AutoCad is not updated from "undocked" Dialog
The sample below (Update!.odcl) deletes entities of the current selection set
If the Dialog isn't docked AutoCad is updated by (dcl_SetCmdBarFocus)
If the Dialog is docked AutoCad is updated when mouse moved off the dialog (dcl_SetCmdBarFocus doesn't works)

> Please open "Update!.odcl" select something and press DELETE :

(defun c:go ()
  (command "OPENDCL")
  (dcl_Project_Load "Update!" T)
  (dcl_Form_Show Update!_Form1) ; ControlBar
;;;  (dcl_Form_Show Update!_Form2) ; Palette
;;;  (dcl_Form_Show Update!_Form3) ; Modeless
  (princ)
)
(defun c:Update!_Form1_TextButton1_OnClicked (/ sel cnt)
  (setq sel (cadr (ssgetfirst))
   cnt (sslength sel))
 
  (repeat cnt
    (setq cnt (1- cnt))
    (setq obj (vlax-ename->vla-object (ssname sel cnt)))
    (vla-delete obj)
    (dcl_SetCmdBarFocus) ; Updates only if "undocked" Dialog
  )
)


"Save changes ?" alert is not fired (Interface)
This happens only with new and freshly saved files, it doesn't happen with opened and modified files.

> Open DCLstudio, add a dialog, and save it. Now properties and events modifications (I have not tried other) doesn't fire the alert


Title: Re: Short list of imperfections
Post by: krunch on March 07, 2011, 03:58:59 PM
ToolTip of Labels are not displayed
Tested in Modal Modeless and ControlBar
Title: Re: Short list of imperfections
Post by: Fred Tomke on March 08, 2011, 11:22:37 AM
Quote from: krunch on March 07, 2011, 03:58:59 PM
ToolTip of Labels are not displayed
Tested in Modal Modeless and ControlBar

Hi krunch,

I believe that they are not displayed as long the palette/dockable/modeless form does not keep focus (I mean property KeepFocus of the form). I could reproduce this in my palette made in C# .NET.

Regards,
Fred
Title: Re: Short list of imperfections
Post by: velasquez on March 10, 2011, 03:25:17 AM
Quote from: Fred Tomke on March 08, 2011, 11:22:37 AM
Quote from: krunch on March 07, 2011, 03:58:59 PM
ToolTip of Labels are not displayed
Tested in Modal Modeless and ControlBar

Hi krunch,

I believe that they are not displayed as long the palette/dockable/modeless form does not keep focus (I mean property KeepFocus of the form). I could reproduce this in my palette made in C# .NET.

Regards,
Fred

Hello Fred,

Can you show me a picture of the palette you have created with C #.NET?

Thanks
Title: Re: Short list of imperfections
Post by: Fred Tomke on March 10, 2011, 03:42:29 AM
Hi, velasquez,

Quote from: velasquez on March 10, 2011, 03:25:17 AM
Can you show me a picture of the palette you have created with C #.NET?

Sure I can but it is not so impressive like yours ;) .
It contains drawing data linked with a database from a COM-Server to get out information where the user produced semantic or geometric errors.
The layout of the palettes does not say anything about the code behind to analyze or modify the drawing objects or export information to clipboard, textfile, Excel or OpenOffice.

Regards, Fred
Title: Re: Short list of imperfections
Post by: velasquez on March 10, 2011, 04:10:06 AM
Quote from: Fred Tomke on March 10, 2011, 03:42:29 AM
Hi, velasquez,

Quote from: velasquez on March 10, 2011, 03:25:17 AM
Can you show me a picture of the palette you have created with C #.NET?

Sure I can but it is not so impressive like yours ;) .
It contains drawing data linked with a database from a COM-Server to get out information where the user produced semantic or geometric errors.
The layout of the palettes does not say anything about the code behind to analyze or modify the drawing objects or export information to clipboard, textfile, Excel or OpenOffice.

Regards, Fred

Thank you Fred,
Once I could see what you got work with vertical TabStrip.
Can you show me how it looks when it docked?

Regards, Velasquez
Title: Re: Short list of imperfections
Post by: Fred Tomke on March 10, 2011, 08:43:35 AM
Quote from: velasquez on March 10, 2011, 04:10:06 AM
Once I could see what you got work with vertical TabStrip.
Can you show me how it looks when it docked?

Hi, velasquez, since there are 22 listview columns in the listview, the form was set that docking is not allowed. It would look like any other Autodesk palette sets with multiple palettes.

You cannot compare the OpenDCL palette with the AutoCAD "palette":
If you want to define a "palette" in C# you have to define a new class which creates a new instance from the Autodesk.AutoCAD.Windows.PaletteSet class. Then you create a custom control in you project with the whole content of the palette. Then you add an instance of you custom control to the paletteset. For an other tab of your C# palette you either add an other instance of your custom control or you create another custom control and then you add it to the paletteset, too. And so on. That's why the number of tabs in the object properties manager differ from AutoCAD base product to the verticals.

In OpenDCL it seems for me that you just define the content for the first palette of the palette set.

Regards, Fred
Title: Re: Short list of imperfections
Post by: krunch on March 14, 2011, 04:29:09 AM
QuoteQuote from: krunch on March 07, 2011, 04:58:59 PM
ToolTip of Labels are not displayed
Tested in Modal Modeless and ControlBar

Hi krunch,

I believe that they are not displayed as long the palette/dockable/modeless form does not keep focus (I mean property KeepFocus of the form). I could reproduce this in my palette made in C# .NET.

Regards,
Fred

Hi Fred
I've tried with KeepFocus=T (ControlBar) but the tooltips still doesn't appear on Label
Regards
Title: Re: Short list of imperfections
Post by: krunch on March 14, 2011, 04:53:48 AM
Display problem (ControlBar - AllowResizing=nil) : cropped when opened without argument

The ControlBar (AllowResizing=nil) are cropped if opened by (dcl_Form_Show) without X Y position arguments
See sample below

Code (autolisp) Select
(defun c:go ()
  (command "OPENDCL")
  (dcl_Project_Load "cropped2!" T)
  (dcl_Form_Show cropped2!_Form1)            ; ControlBar    cropped!
  (dcl_Form_Show cropped2!_Form2)            ; Palette       ok
;;;  (dcl_Form_Show cropped2!_Form1 0 0)     ; ControlBar    ok
;;;  (dcl_Form_Show cropped2!_Form2 0 0)     ; Palette       ok
  (princ)
)
Title: Re: Short list of imperfections
Post by: krunch on March 14, 2011, 05:25:05 AM
Stacked ControlBar and Palette (AllowResizing=nil)
Just another little thing with ControlBar and Palette (AllowResizing=nil) when "docked" (floating=nil) and stacked with another dialog (here with the standart Properties Palette).

In this case we can expand the dialog but not reduce it, by moving the border..
But when I attempt to reduce it, the 2nd DialogBox seems to be cropped.
On this screenshoot I move the right border to the left :
Title: Re: Short list of imperfections
Post by: krunch on March 16, 2011, 03:39:52 AM

I've found a solution for one of my previous remark : Update problem...

This problem concerns updates of the drawing and the graphic screen, such as vla-delete, vla-highlight, grvecs...*, when called by a click on a Button or a Picture* : the update is made (visible) only when the cursor looses focus (* I haven't tried other)

It can be solved by adding a (princ) ! Note that (princ "something") doesn't work : only (princ) !

To see that, run the sample below :
- select objects and click on the Button/Picture > objects are deleted
- now disable the (princ) and try again             > the operation is updated when the cursor moves off the dialog box (when lost focus ?)


Code (autolisp) Select
(defun c:go ()
  (vl-load-com)
  (command "OPENDCL")
  (dcl_Project_Load "Update!" T)
  (dcl_Form_Show Update!_Form1) ; ControlBar (docked)
  (dcl_Form_Show Update!_Form2) ; Palette (docked)
  (dcl_Form_Show Update!_Form3) ; Modeless
  (princ)
)
(defun c:main_OnClicked (/ sel cnt)
  (setq sel (cadr (ssgetfirst))
    cnt (sslength sel))
 
  ; vla-delete the current selection set
  (repeat cnt
    (setq cnt (1- cnt))
    (setq obj (vlax-ename->vla-object (ssname sel cnt)))
    (vla-delete obj)
  )
 
  (princ) ; < THE princ !
)
Title: Re: Short list of imperfections
Post by: krunch on March 16, 2011, 04:28:36 AM
A strange and vicious thing with Application bar + OnKillFocus..

This is a strange behavior concerning the Application window main bar (above) : in some cases the Application window is reduced when you click on the main bar

Please see the sample below..

Apparently this problem occurs :
- if the TextBox triggers a OnKillFocus function
- if this function contains an OpenDCL property (/method /function ?) to evaluate
- if the TextBox looses focus when you click on the main bar..
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 07:47:51 AM
It would be easier to address each of your issues one by one, but this is difficult when they are all in one post, and some have since been superseded.  In the future, please create separate threads for unrelated problems.  I think I will start at the end and work backward for the other problems, but first I can dispense with the first issue in the first post: this is a known problem with no known solution.
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 09:06:47 AM
Quote from: krunch on March 16, 2011, 04:28:36 AM
A strange and vicious thing with Application bar + OnKillFocus

Good catch. That is indeed a strange one. I can reproduce the problem in any version of AutoCAD (on Windows 7), but I'm not sure what causes it. It seems like AutoCAD sends the "left button clicked" a second time when it appears that the first time got sidetracked, but the second message then gets interpreted as a double click. I tried some things to see if I could fix the problem, but I did not find any solution. The problem goes away when Keep Focus is disabled.

This should be added to the bug tracker on SourceForge to ensure that it is logged for future fixing.
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 09:17:03 AM
Quote from: krunch on March 16, 2011, 03:39:52 AM
It can be solved by adding a (princ) !

I suspect that (dcl_SetCmdBarFocus) would work also.
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 09:19:27 AM
Quote from: krunch on March 14, 2011, 05:25:05 AM
In this case we can expand the dialog but not reduce it, by moving the border..

This should be added to the bug tracker so I can revisit it in OpenDCL 7.
Title: Re: Short list of imperfections
Post by: krunch on March 16, 2011, 10:30:09 AM
QuoteIt would be easier to address each of your issues one by one
QuoteThis should be added to the bug tracker on SourceForge to ensure that it is logged for future fixing
OK

QuoteQuote from: krunch on Today at 03:39:52 AM
It can be solved by adding a (princ) !

I suspect that (dcl_SetCmdBarFocus) would work also.

This is exactly what I used, but (dcl_SetCmdBarFocus) doesn't work anymore if the Palette/ControlBar is docked !
Please try this in the sample below

Code (autolisp) Select
(defun c:go ()
  (vl-load-com)
  (command "OPENDCL")
  (dcl_Project_Load "Update!" T)
  (dcl_Form_Show Update!_Form1) ; ControlBar
  (dcl_Form_Show Update!_Form2) ; Palette
  (dcl_Form_Show Update!_Form3) ; Modeless
  (princ)
)
(defun c:Update!_Form1_TextButton1_OnClicked (/ sel cnt)
  (setq sel (cadr (ssgetfirst))
    cnt (sslength sel))
 
  (repeat cnt
    (setq cnt (1- cnt))
    (setq obj (vlax-ename->vla-object (ssname sel cnt)))
    (vla-delete obj)
  )

;;;  (dcl_SetCmdBarFocus)     ; Updates only if "undocked" Dialog
  (princ)            ; Updates in all cases
)
Title: Re: Short list of imperfections
Post by: krunch on March 16, 2011, 10:37:42 AM
QuoteQuote from: krunch on March 14, 2011, 05:25:05 AM
In this case we can expand the dialog but not reduce it, by moving the border..

This should be added to the bug tracker so I can revisit it in OpenDCL 7.

This is a specific case where you stack 2 palettes or ControlBar, and one can not be resized (AllowResizing=nil) while the other can be (T). So, I don't know wich palette have to keep priority...
The point is that the 2nd palette is affected (cropped?) when you attempt to resize
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 03:03:48 PM
Quote from: krunch on March 07, 2011, 03:58:59 PM
ToolTip of Labels are not displayed

This is now fixed for the next build. You can work around the problem in the meantime by enabling the MouseMove event (even if no handler is defined).
Title: Re: Short list of imperfections
Post by: owenwengerd on March 16, 2011, 03:06:14 PM
Quote from: krunch on March 02, 2011, 06:12:10 AM
"Save changes ?" alert is not fired (Interface)

Can you give precise instructions for reproducing this?
Title: Re: Short list of imperfections
Post by: BazzaCAD on March 16, 2011, 03:20:42 PM
Quote from: owenwengerd on March 16, 2011, 03:06:14 PM
Quote from: krunch on March 02, 2011, 06:12:10 AM
"Save changes ?" alert is not fired (Interface)

Can you give precise instructions for reproducing this?

Ya I can reproduce this one too.
Start a new project, add a form, Save, now change a property (disable titlebar), hit the red X to close & not prompted to save..
Title: Re: Short list of imperfections
Post by: krunch on March 17, 2011, 09:03:18 AM
Hi
To complete this post I have done some new tests on display and behavior problems of ControlBar + Palette

They include 2 previous remarks (+ some new one):
Incohérence (ControlBar) : resizing handles appear while Resizing=nil
Stacked ControlBar and Palette (AllowResizing=nil)


1- Display size is approximative

On the fist image below you can see the Palette+ControlBar in 2 context (floating+docked). The red mask delimits the original size (248x448), and you can see that :
- ControlBar (floating) is bigger (vertically)
- ControlBar (docked) same gap
- Palette (floating) is smaller (the border goes in)
- Palette (docked) is bigger..

I don't know, but may be those gaps (a fiew pixels) come back in the following tests ?


2- Attempting to resize docked (AllowResizing=nil) Forms : noAllowResizing.odcl

Now I keep only one of the 2 Forms, I dock it, and I attempt to resize (drag'ndrop the vertical border)..
> The 'resize' cursor (lfet-right arrow) is displayed when the cursor rolls on the border (although AllowResizing=nil)

> When I attempt to resize a docked Palette, it 'moves' alternatively between 2 sizes : a few pixels more, less, more....
> When I attempt to resize a docked ControlBar, it seems to 'move' once (only the first time)

Now I stack vertically the two forms
> Same thing, it 'moves' alternatively between 2 sizes, and the horizontal separator is moving too, same thing if I move it


3- Same test with mixed AllowResizing (T+nil) : mixedAllowResizing.odcl

On the second image the white Form is set to AllowResizing=T, the grey one is AllowResizing=nil...
> Same problem When I expand or reduce : all is moving, you can see the offset of the horizontal separator on the screenshoot

When I expand I get the 1st image (on the left)
> OK (may be the grey background color could be expanded too ?)

When I reduced I get the 2nd (on the right)
> As you can see the white ControlBar is cropped when I reduce under the width of the grey form (AllowResizing=nil)

So in this case (AllowResizing=nil+T) I think there are those 2 problems (all is mooving when resizing + resizable form is cropped)
But I think that the general behavior is ok, ie : expanding is allowed / reducing is limited to the size (width or height) of the Form whose AllowResizing=nil

Title: Re: Short list of imperfections
Post by: owenwengerd on March 19, 2011, 05:06:46 AM
Quote from: krunch on March 02, 2011, 06:12:10 AM
"Save changes ?" alert is not fired (Interface)

This is now fixed for the next build.
Title: Re: Short list of imperfections
Post by: velasquez on April 05, 2011, 01:09:00 PM
Hi Owen

Quote from: owenwengerd on March 19, 2011, 05:06:46 AM
Quote from: krunch on March 02, 2011, 06:12:10 AM
"Save changes ?" alert is not fired (Interface)

This is now fixed for the next build.

Why the appearance of Control Palette Bar and is modified along with the display of AutoCAD?
His answer is that either.
Thanks
Title: Re: Short list of imperfections
Post by: owenwengerd on April 05, 2011, 01:47:58 PM
I guess you're referring to the top edge of the form?  I'm not sure why that would have changed. Can you be more specific about what exactly changed, and when?
Title: Re: Short list of imperfections
Post by: velasquez on April 06, 2011, 03:36:39 AM
Quote from: owenwengerd on April 05, 2011, 01:47:58 PM
I guess you're referring to the top edge of the form?  I'm not sure why that would have changed. Can you be more specific about what exactly changed, and when?

Yes you are right.
Change happens when Control Bar is no longer anchored or when it is dragged from left to right.
It also happens when a palette is docked at his side.
And when a screen capture program like Snagit is called.
Title: Re: Short list of imperfections
Post by: velasquez on May 04, 2011, 05:21:17 AM
Quote from: owenwengerd on April 05, 2011, 01:47:58 PM
I guess you're referring to the top edge of the form?  I'm not sure why that would have changed. Can you be more specific about what exactly changed, and when?

Yes I'm referring to to the top edge of the form.
He continues with OpenDCL 6.0.2.3
It also appears that the display of AutoCAD is minimized and then restored.
Title: Re: Short list of imperfections
Post by: owenwengerd on May 04, 2011, 02:16:07 PM
It would be useful to know which version of OpenDCL this changed in so I can try to find the change that caused it.
Title: Re: Short list of imperfections
Post by: velasquez on May 05, 2011, 06:56:59 AM
Quote from: owenwengerd on May 04, 2011, 02:16:07 PM
It would be useful to know which version of OpenDCL this changed in so I can try to find the change that caused it.

OK
I'll try testing out my old versions.
Title: Re: Short list of imperfections
Post by: velasquez on May 25, 2011, 05:13:44 AM
Quote from: velasquez on May 05, 2011, 06:56:59 AM
Quote from: owenwengerd on May 04, 2011, 02:16:07 PM
It would be useful to know which version of OpenDCL this changed in so I can try to find the change that caused it.

OK
I'll try testing out my old versions.

I could not determine which version this problem appeared.
But he remains in OpenDCL 6.0.2.3

Thanks