Author Topic: What would it take to convert from object dcl to open dcl?  (Read 48113 times)

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #15 on: November 25, 2009, 08:56:31 PM »
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

  • OpenDCL Webmaster
  • Administrator
  • Hero Member
  • *****
  • Posts: 853
  • Cylons will kill you
    • OpenDCL
Re: What would it take to convert from object dcl to open dcl?
« Reply #16 on: November 25, 2009, 09:23:36 PM »
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]})

Quote
If 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

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #17 on: November 25, 2009, 09:25:40 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

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #18 on: November 26, 2009, 04:47:04 AM »
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

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #19 on: November 26, 2009, 05:17:23 AM »

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

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #20 on: November 26, 2009, 05:22:48 AM »
Kerry you are awesome!  that is incredible, now I just have to figure out what you did! :)

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #21 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!

Kerry

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #22 on: November 26, 2009, 05:43:09 AM »
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

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #23 on: November 26, 2009, 05:48:44 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
« Last Edit: November 26, 2009, 05:52:02 AM by Kerry Brown »
Perfection is not optional.
My other home is TheSwamp

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #24 on: November 26, 2009, 05:56:15 AM »
Yes I have tried that a bunch of times.... no luck. ugh.

Kerry

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #25 on: November 26, 2009, 05:59:43 AM »

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

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #26 on: November 26, 2009, 06:13:08 AM »
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

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #27 on: November 26, 2009, 06:19:35 AM »
screen shot attached......showing clicked button settings....

Hypersonic

  • Full Member
  • ***
  • Posts: 123
Re: What would it take to convert from object dcl to open dcl?
« Reply #28 on: November 26, 2009, 06:25:56 AM »
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

  • Mesozoic Relic
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 433
  • class keyThumper<T>
Re: What would it take to convert from object dcl to open dcl?
« Reply #29 on: November 26, 2009, 06:27:48 AM »
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