dcl_form_getcontrols

Started by Kerry, February 22, 2008, 09:02:07 PM

Previous topic - Next topic

Kerry



The Help File has a Section Topic named Modify Projects Programmatically which has a routine named SetOdclFontSizeUnscaled() ...
The routine seems to crash at dcl_form_getcontrols

.. with an invalid argument type  error :- Argument: 0

I know this routine has worked in the past because I modified it to change the TextFont for all controls ..

.. any ideas ?

regards
kerry


(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)
)


(setq odclfile    "F:\\xxxx_rev.odc"
      password    nil
      newodclpath "F:\\xxxx_rev.Modified.odcl"
)

(setodclfont-msshelldlg odclfile nil newodclpath)


Perfection is not optional.
My other home is TheSwamp

BazzaCAD

a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Kerry

#2
Thanks Barry .. I'll keep an eye out for Beta Alpha 6. :-)


I have a collection of old OpenDCL forms and code to revise, so this will be handy.

( the code calls odcl_xxxx and the ..2007.ARX is dated 20061018 ... that will give you an idea of the vintage )


Perfection is not optional.
My other home is TheSwamp