OpenDCL 6 Display Issues

Started by owenwengerd, December 06, 2009, 10:42:23 PM

Previous topic - Next topic

copter

Hi Fred
I moved it . Funny.
But I tried your project. Doesnt not work for me (Vista+R2009)
What did you changed exactly ?

Copter

Fred Tomke

QuoteDoesnt not work for me (Vista+R2009)

Did not? Hm, have you (re)loaded the right project?

QuoteWhat did you changed exactly ?

First thing I do whenever I get display errors is to set the background of all rectangles, optionbuttons, checkboxes and captions to -16. So I did this time and it worked perfectly for me.
(XP 32 Bit C3DR2009)

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

copter

I confirm. I downloaded the right one with background = -16.
Same issue.
And, If I move the form outside the screen, the X and Y labels are black , not red.


Kerry

#48

on my XP 32bit

Fred's Test16-1.odcl from #PostReply 44 displays as I'd expect

Copter's Test16-1.odcl from #PostReply 43 displays initially without the Label Caption and without the top row of  CheckBox controls.

The checkbox controls display after a mouseOver
or both LabelCaptions and CheckBoxs show after dragging offscreen and returning .... but with the LabelCaption Color as Black.


I recall demonstration (on Owen's advice) in one of my posts that changing the BackGroundColor to ButtonFace(-16) for the Rectangle and the OptionBox controls fixed the display issue.
Perfection is not optional.
My other home is TheSwamp

Kerry


Owen, thanks for your endevours particularly with this 6.xx change issue.
Can you see any advantages in performance ( we know about the changes to old code)

Kerry.

Perfection is not optional.
My other home is TheSwamp

owenwengerd

I can't say that I've noticed much change in performance, but the code is a heck of a lot simpler and easier to maintain now.

Kerry

Quote from: Fred Tomke on December 15, 2009, 07:58:13 AM
Hello, I have another one:

have a look at this sample. The loaded dwgpreview are only getting visible after moving the form outside the windows first.

Fred

For Build [6.0.0.17]
I assume this has not yet been addressed.
I have a similar situation.

Modal dialog, Simple layout (no frames, Rectangles, tabs ....
This code loads the DwgPreview control with a drawing selected from a listbox.
Code (autolisp) Select

;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
;;;
(defun c:KDUB_BlockInserter_Main_ListBox_OnSelChanged (ItemIndex Value /)
 (dcl_dwgpreview_loaddwg KDUB_BlockInserter_Main_DwgPreview1
                         (strcat G1003-SelectedFolder "\\" Value)
 )
)
;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
;;;


The DwgPreview control does not display untill either
a) the control is selected.
or b) the form is dragged offscreen and back on.

I'll put together a tester if you want.

This is with WinXP x32
I don't have the new win7 x64 box loaded yet

Regards
Kerry
Perfection is not optional.
My other home is TheSwamp

Kerry

As a work-around, I'm forcing a redraw of the control
Code (autolisp) Select

;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
;;;
(defun c:KDUB_BlockInserter_Main_ListBox_OnSelChanged (ItemIndex Value /)
  (dcl_dwgpreview_loaddwg KDUB_BlockInserter_Main_DwgPreview1
                          (strcat G1003-SelectedFolder "\\" Value)
  )
  (dcl_Control_Redraw KDUB_BlockInserter_Main_DwgPreview1) ;; <-- redraw added for workaround : kdub 20091228
)
;;;---------------------------------------------------------------------------
;;;---------------------------------------------------------------------------
;;;
Perfection is not optional.
My other home is TheSwamp

owenwengerd

I would like to see a sample modeless form with only one dwgpreview control that exhibits the problem. I still have some cases where the control painting fails, but I haven't been able to pin down the cause. I'm suspicious that something triggers an infinite painting loop that Windows detects and cancels, but in my tests the problem seems to disappear when the form is simplified.

Kerry

#54
Demo/Sample

Code (autolisp) Select

;;K60017h.lsp
;;K60017h.odcl
;|
KWBrown 20091229
for OpenDCL 6.0.0.17 testing
to demonstrate painting of DwgPreview control
|;
;; Initial folder for DirectoryPicker

(setq g:K60017h_RootFolder "J:\\Blocks")


(defun c:DOIT (/) (c:K60017h))

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h (/)
 ;; Codehimbelonga kdub@opendcl.com
 (vl-load-com)
 (command "._OPENDCL")
 (dcl_project_load "K60017h.odcl" t)
 (if (not (dcl_form_isactive K60017h_F))
   (dcl_form_show K60017h_F)
 )
 (princ)
)
(princ "\n K60017h to run.")
(princ)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_OnInitialize (/ ParentID Folders)
 (dcl_control_settext K60017h_F_RootFolder g:K60017h_RootFolder)
 ;;
 (setq ParentID (dcl_tree_addparent K60017h_F_Tree g:K60017h_RootFolder 0 -1 1))
 (if (= ".." (cadr (setq Folders (vl-directory-files g:K60017h_RootFolder NIL -1))))
   (setq Folders (cddr Folders))
 )
 ;;
 (foreach folder Folders
   (dcl_tree_addchild
     K60017h_F_Tree
     (list (list ParentID folder (strcat g:K60017h_RootFolder "\\" folder) 2 3))
   )
 )
 (dcl_tree_expanditem K60017h_F_Tree ParentID 1)
 ;;
 (dcl_tree_selectitem K60017h_F_Tree
                      (dcl_tree_getfirstchilditem K60017h_F_Tree ParentID)
 )
)
;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_Tree_OnSelChanged (Label Key / SubFiles SubFolders subList)
 ;;
 ;| Description:



 |;
 (dcl_listbox_clear K60017h_F_ListBox)
 ;;
 ;;(or (= (type Key) 'str) (setq Key g:K60017h_RootFolder))
 (if (= (type Key) 'str)
   (progn
     (setq g:SelectedFolder key
           SubFiles         (vl-directory-files g:SelectedFolder "*.DWG" 1)
     )
     (if (= ".." (cadr (setq SubFolders (vl-directory-files g:SelectedFolder NIL -1))))
       (setq SubFolders (cddr SubFolders))
     )
   )
 )
 ;;
 (if SubFolders
   (progn (setq subList '())
          (foreach folder SubFolders
            (setq subList (cons (list g:SelectedFolder
                                      folder
                                      (strcat g:SelectedFolder "\\" folder)
                                      2
                                      3
                                )
                                subList
                          )
            )
          )
          (dcl_tree_addchild K60017h_F_Tree (reverse subList))
   )
 )
 ;;
 (if subFiles
   (progn (setq subList '())
          (foreach file subFiles (setq subList (cons file subList)))
          (dcl_listbox_clear K60017h_F_ListBox)
          (dcl_listbox_addlist K60017h_F_ListBox (reverse subList))
          ;;
          (dcl_listbox_setcursel K60017h_F_ListBox 0)
          (dcl_dwgpreview_loaddwg
            K60017h_F_DwgPreview
            (strcat g:SelectedFolder "\\" (dcl_listbox_getitemtext K60017h_F_ListBox 0))
          )
          ;; (dcl_Control_Redraw K60017h_F_DwgPreview) ;; <-- redraw added for workaround : kdub 20091228  
     )
 )
)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_ListBox_OnSelChanged (ItemIndexOrCount Value /)
 (dcl_dwgpreview_loaddwg K60017h_F_DwgPreview (strcat g:SelectedFolder "\\" Value))
 ;;
 ;; (dcl_Control_Redraw K60017h_F_DwgPreview) ;; <-- redraw added for workaround : kdub 20091228  
)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_RootSelect_OnClicked (/ root)
 (if (setq Root (dcl_selectfolder "Select Root Folder" g:K60017h_RootFolder nil))
   (progn (setq g:K60017h_RootFolder root
                g:InsertData nil
          )
          (dcl_tree_clear K60017h_F_Tree)
          (dcl_listbox_clear K60017h_F_ListBox)
          (dcl_dwgpreview_clear K60017h_F_DwgPreview)
          (c:K60017h_F_OnInitialize)
   )
 )
)
;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_DoAllTheWildStuff (/)
 (dcl_MessageBox "To Do: code must be added to event handler\r\nc:K60017h_DoAllTheWildStuff" "K60017h : To do")
)

;;;---------------------------------------------------------------------------
;;;

(princ)


Some attachments
LSP and ODCL Code and 29 seconds of piccys.
Perfection is not optional.
My other home is TheSwamp

Kerry

The video attachment.
As you may see, sometimes the DwgPreview displays, sometimes not.
(refresh [F5] to replay)
Perfection is not optional.
My other home is TheSwamp

owenwengerd

The DwgPreview problem is now fixed for Alpha 18. This was a simple case of not invalidating the control after changing the drawing filename.

Kerry


Thanks Owen,
great to hear it' rectified,
better to hear it was relatively simple

Be well

Perfection is not optional.
My other home is TheSwamp

Kerry


6.0.0.18 fixed the DwgPreview display issue for me ... thanks Owen

Regards
Kerry
Perfection is not optional.
My other home is TheSwamp

superkot007

Quote from: Kerry Brown on December 28, 2009, 07:04:41 PM
Demo/Sample

Code (autolisp) Select

;;K60017h.lsp
;;K60017h.odcl
;|
KWBrown 20091229
for OpenDCL 6.0.0.17 testing
to demonstrate painting of DwgPreview control
|;
;; Initial folder for DirectoryPicker

(setq g:K60017h_RootFolder "J:\\Blocks")


(defun c:DOIT (/) (c:K60017h))

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h (/)
 ;; Codehimbelonga kdub@opendcl.com
 (vl-load-com)
 (command "._OPENDCL")
 (dcl_project_load "K60017h.odcl" t)
 (if (not (dcl_form_isactive K60017h_F))
   (dcl_form_show K60017h_F)
 )
 (princ)
)
(princ "\n K60017h to run.")
(princ)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_OnInitialize (/ ParentID Folders)
 (dcl_control_settext K60017h_F_RootFolder g:K60017h_RootFolder)
 ;;
 (setq ParentID (dcl_tree_addparent K60017h_F_Tree g:K60017h_RootFolder 0 -1 1))
 (if (= ".." (cadr (setq Folders (vl-directory-files g:K60017h_RootFolder NIL -1))))
   (setq Folders (cddr Folders))
 )
 ;;
 (foreach folder Folders
   (dcl_tree_addchild
     K60017h_F_Tree
     (list (list ParentID folder (strcat g:K60017h_RootFolder "\\" folder) 2 3))
   )
 )
 (dcl_tree_expanditem K60017h_F_Tree ParentID 1)
 ;;
 (dcl_tree_selectitem K60017h_F_Tree
                      (dcl_tree_getfirstchilditem K60017h_F_Tree ParentID)
 )
)
;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_Tree_OnSelChanged (Label Key / SubFiles SubFolders subList)
 ;;
 ;| Description:



 |;
 (dcl_listbox_clear K60017h_F_ListBox)
 ;;
 ;;(or (= (type Key) 'str) (setq Key g:K60017h_RootFolder))
 (if (= (type Key) 'str)
   (progn
     (setq g:SelectedFolder key
           SubFiles         (vl-directory-files g:SelectedFolder "*.DWG" 1)
     )
     (if (= ".." (cadr (setq SubFolders (vl-directory-files g:SelectedFolder NIL -1))))
       (setq SubFolders (cddr SubFolders))
     )
   )
 )
 ;;
 (if SubFolders
   (progn (setq subList '())
          (foreach folder SubFolders
            (setq subList (cons (list g:SelectedFolder
                                      folder
                                      (strcat g:SelectedFolder "\\" folder)
                                      2
                                      3
                                )
                                subList
                          )
            )
          )
          (dcl_tree_addchild K60017h_F_Tree (reverse subList))
   )
 )
 ;;
 (if subFiles
   (progn (setq subList '())
          (foreach file subFiles (setq subList (cons file subList)))
          (dcl_listbox_clear K60017h_F_ListBox)
          (dcl_listbox_addlist K60017h_F_ListBox (reverse subList))
          ;;
          (dcl_listbox_setcursel K60017h_F_ListBox 0)
          (dcl_dwgpreview_loaddwg
            K60017h_F_DwgPreview
            (strcat g:SelectedFolder "\\" (dcl_listbox_getitemtext K60017h_F_ListBox 0))
          )
          ;; (dcl_Control_Redraw K60017h_F_DwgPreview) ;; <-- redraw added for workaround : kdub 20091228  
     )
 )
)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_ListBox_OnSelChanged (ItemIndexOrCount Value /)
 (dcl_dwgpreview_loaddwg K60017h_F_DwgPreview (strcat g:SelectedFolder "\\" Value))
 ;;
 ;; (dcl_Control_Redraw K60017h_F_DwgPreview) ;; <-- redraw added for workaround : kdub 20091228  
)

;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_F_RootSelect_OnClicked (/ root)
 (if (setq Root (dcl_selectfolder "Select Root Folder" g:K60017h_RootFolder nil))
   (progn (setq g:K60017h_RootFolder root
                g:InsertData nil
          )
          (dcl_tree_clear K60017h_F_Tree)
          (dcl_listbox_clear K60017h_F_ListBox)
          (dcl_dwgpreview_clear K60017h_F_DwgPreview)
          (c:K60017h_F_OnInitialize)
   )
 )
)
;;;---------------------------------------------------------------------------
;;;
(defun c:K60017h_DoAllTheWildStuff (/)
 (dcl_MessageBox "To Do: code must be added to event handler\r\nc:K60017h_DoAllTheWildStuff" "K60017h : To do")
)

;;;---------------------------------------------------------------------------
;;;

(princ)


Some attachments
LSP and ODCL Code and 29 seconds of piccys.
Thank you so much!!!
This is exactly what I needed!!!