What would it take to convert from object dcl to open dcl?

Started by Hypersonic, November 25, 2009, 03:52:56 AM

Previous topic - Next topic

Hypersonic

Thank you Owen, I am making some progress, it appears I have to rename the old .odc files to .odcl, so I have done that to one only right now as I am trying to get one to work.

I have the dialog popping up now, but the buttons don't seem to work, I checked the even button and even re-copied the on-clicked command into my lsp routine.   But it acts like I am not clicking on the button at all....

Any thoughts?
Thanks again!

BazzaCAD

Your projects probably have the old (VarName) symbols set.
You could try the NewProjectKey argument in:
(dcl_Project_Load ProjectFilePath [as String] {ForceReload [as Boolean]} {NewProjectKey [as String]})

QuoteIf the optional NewProjectKey is specified, it replaces the project key saved in the project data.

Or you could try Tools-->Clear Lisp Symbol Names, but that may require you to change the Event names in your Lsp.

You might want to post an example if those don't work.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Kerry

Quote from: Hypersonic on November 25, 2009, 07:47:24 PM
Inforapid search and replace is a free downloadable tool to do some of the global search and replace things listed in the migration guide.
Maybe this (or something like it) is already listed somewhere, but if not it might save some people a few hours...
Just a thought
Thanks for all your help!
-

Thanks Hypersonic.

I use UltraEdit UEStudio http://www.ultraedit.com/
good tools make a big difference.
Perfection is not optional.
My other home is TheSwamp

Hypersonic

Ugh, not having much luck......
A simplified lisp file for the form is below, i.e. it just has the call to textbutton5 shown (marked reload library on the form)
and the .odcl file is attached.....  I reset the variable names and copied in the new lisp "command" but it just acts dead...
Both the form show, and form close work though....
Any thoughts?  Thank You!

;debugging_tools_DBForm1
;(load (strcat lsp_dir "debug/debugging_tools"))


(defun c:debugging_tools ()
(princ "\n in debugging_tools ")
(setq compname (getenv "COMPUTERNAME"))

(if (not (or (eq compname "BOBLAPTOP") (eq compname "OTHERBOB")))
   (setq temp (getstring "Say please"))
   (setq temp "buba")
)

(if (eq temp "buba")
(progn
  (setq temp nil);so it is not saved...


(command "_OPENDCL") ; ensure the ObjectDCL.arx file is loaded

(setq project (strcat lsp_dir "debug/debugging_tools"))

(if (eq (getenv "COMPUTERNAME") "BOBLAPTOP")
   (dcl_project_load project T)                ;adding the T forces reload, i.e. for while makeing changes.....
   (dcl_project_load project)                  ;it is recommended to remove for distribution copy.....
)   


(dcl_Form_Show debugging_tools_DBForm1)

;(dcl_Form_Close debugging_tools_DBForm1)


(setq tp_list_file (strcat lsp_dir "debug/test_point_list.txt"))
(setq show_tp_list (get_info tp_list_file "show_tp_list"))

);end progn
);end if

(princ "\n leaving debugging_tools ")
(princ)
);end defun


(defun c:debugging_tools_DBForm1_TextButton5_OnClicked (/)
  (dcl_MessageBox "To Do: code must be added to event handler\r\nc:debugging_tools_DBForm1_TextButton5_OnClicked" "To do")
)

Kerry


I made some changes ... just to get the form to show and Button5 to work.

I also changed ALL the test Sizes to be in pixels, NOT Scaled to Monitor ' cause the text was too big on my Monitor

Code (autolisp) Select

                                                            ;debugging_tools_DBForm1
                                                            ;(load (strcat lsp_dir "debug/debugging_tools"))

(defun c:doit () (c:debugging_tools))
(defun c:debugging_tools ()
;;;  (princ "\n in debugging_tools ")
;;;  (setq compname (getenv "COMPUTERNAME"))
;;;  (if (not (or (eq compname "BOBLAPTOP") (eq compname "OTHERBOB")))
;;;    (setq temp (getstring "Say please"))
;;;    (setq temp "buba")
;;;  )
;;;  (if (eq temp "buba")
;;;  (if T
;;;    (progn (setq temp nil)                                  ;so it is not saved...
 
  (command "_OPENDCL")                                      ; ensure the ObjectDCL.arx file is loaded
  ;;(setq project (strcat lsp_dir "debug/debugging_tools"))
 
  (setq project (findfile "debugging_tools.odcl"))
;;;           (if (eq (getenv "COMPUTERNAME") "BOBLAPTOP")
 
  (dcl_project_load project t)                              ;adding the T forces reload, i.e. for while makeing changes.....
;;;             (dcl_project_load project )                     ;it is recommended to remove for distribution copy.....
;;;           )
 
  (dcl_form_show debugging_tools_dbform1)                   ;(dcl_Form_Close debugging_tools_DBForm1)
;;;           (setq tp_list_file (strcat lsp_dir "debug/test_point_list.txt"))
;;;           (setq show_tp_list (get_info tp_list_file "show_tp_list"))
;;;    )                                                       ;end progn
;;;  )                                                         ;end if
  (princ "\n leaving debugging_tools ")
  (princ)
)                                                           ;end defun


(defun c:debugging_tools_dbform1_textbutton5_onclicked (/)
  (dcl_messagebox
    "To Do: code must be added to event handler\r\nc:debugging_tools_DBForm1_TextButton5_OnClicked"
    "To do"
  )
)
Perfection is not optional.
My other home is TheSwamp

Hypersonic

Kerry you are awesome!  that is incredible, now I just have to figure out what you did! :)

Hypersonic

Oh bugger...... still stuck, I copy your exact code into my routine, and it still does not run.... dialog comes up, button is dead.......

How did you tweak the text size? I am having the same problem on my end.  Thank you!

Kerry

As you have a few to revise .. try this

It will Change the font to "MS Shell Dlg"
and the Size to be in Pixels rather than By Monitor Size

Note that I've changed the original ODCL file Name before running the Lisp.

Code (autolisp) Select

;; CodeHimBelongs kdub
;;
(defun setOdclFont-msShellDlg (odclfile    password
                              newodclpath /
                              project     props
                              fontsize
                             )
 (setq project (dcl_project_load odclfile))
 (if (not project)
   (exit)
 )
 (foreach form (dcl_project_getforms project)
   (foreach control (dcl_form_getcontrols form)
     (progn
       (setq props (dcl_control_getproperties control))
       (if (member "FontSize" props)
         (progn (setq
                  fontsize (dcl_control_getproperty control
                                                    "FontSize"
                           )
                )
                (if (> fontsize 0)
                  (dcl_control_setproperty control
                                           "FontSize"
                                           (- 0 fontsize)
                  )
                )
         )
       )
       (if (member "Font" props)
         (dcl_control_setproperty control
                                  "Font"
                                  "MS Shell Dlg"
         )
       )
;;;        (if (member "FontSize" props)
;;;          (dcl_control_setproperty control "FontSize" -10)
;;;        )
     )
   )
 )
 (dcl_project_saveas project newodclpath password)
)



Code (autolisp) Select

(setq odclfile    (findfile "debugging_tools_original.odcl")
     password    nil
     newodclpath "K:\\kdubpro\\debugging_tools.odcl"
)

(setOdclFont-msShellDlg  odclfile nil newodclpath)
Perfection is not optional.
My other home is TheSwamp

Kerry

#23
Quote from: Hypersonic on November 26, 2009, 05:38:48 AM
Oh bugger...... still stuck, I copy your exact code into my routine, and it still does not run.... dialog comes up, button is dead.......

How did you tweak the text size? I am having the same problem on my end.  Thank you!

Open the ODCL in the editor
Select TextButton5
Select the Event Tab

Unselect, then Re-select the Clicked option.

Make sure theEvent function name in your code is the same as you Event function name in the Event pane

If you change them ; Unselect, then Re-select the Clicked option.

SAVE the ODCL.


For instance
TextButton7 Click event is currently
c:DBForm1_TextButton7_OnClicked
when you unselect and re-select the option the Function name becomes
c:debugging_tools_DBForm1_TextButton7_OnClicked
Perfection is not optional.
My other home is TheSwamp

Hypersonic

Yes I have tried that a bunch of times.... no luck. ugh.

Kerry


Warning : this is edited with 6.0.0.14 , so be sure to backup your current file.

Perfection is not optional.
My other home is TheSwamp

Hypersonic

I downloaded that, and I know its your file, because the text is fixed...... checked the call to the button, pasted the call into my routine.
It did match the old call, but still same exact thing..... button is dead.......

Hypersonic

screen shot attached......showing clicked button settings....

Hypersonic

Perhaps an issue with useing 5.1.2.3  ??  I tried adding a button and it showed up on the editor etc. but then it sort of wouldn't select etc.... Maybe I need the version you are using?  I am not sure that makes sense being as I am upgrading from objectDCL 3.x ??

Thanks, B.

Kerry

Can you re-post the ODCL and LSP for Owen please.

He may be able to "Spy" it.

Please Confirm which Version you are using.


Just an aside : off topic.
If you drag the Control Tab/Z-Order Pane from under the Properties Pane to under the Project Pabe on the Left
... you'll have more room for the Properties
Perfection is not optional.
My other home is TheSwamp