Author Topic: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16  (Read 6529 times)

0 Members and 1 Guest are viewing this topic.

grrrr

  • Guest
DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« on: January 05, 2010, 03:04:55 PM »
hi,

i would like to fill a grid with (dcl_Grid_FillList testgrid_CSVDialog_GRID1 data).
data means a list of list representing row data.
some columns are declared as colortype maybe 30 or 31.
i can try all formats what available.
sample:  1, "1", "255,0,0" but neither the data apeare in the colorbox
nor color is set in the colordialog.

the same problem appears on columntype 1. the checkbox isn't marked if data 1 or "1".


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #1 on: January 05, 2010, 07:02:38 PM »
You may be better served posting at the OpenDCL Forum site.

http://www.opendcl.com/forum/index.php

... although most of the OpenDCL folk visit here regularly.

Either way, I'd advise that you post a small .ODCL and .LSP to demonstrate your issue.

BTW, the current build is 6.0.0.18 and it may be worth loading that. The current work being done on control painting may already solve your issue :)


ps: Welcome to theSwamp :)
« Last Edit: January 05, 2010, 07:34:54 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #2 on: January 06, 2010, 12:08:34 AM »
Is this what you had in mind ??


Code: [Select]

(vl-load-com)
;;; CodeHimBelongs kdub@theSwamp (Kerry Brown) 20100106
(defun c:pprops ()
  (command "_opendcl")
  ;;(dcl_project_load "pprops" t)
  (dcl_project_load "pprops" )
  (if (not (dcl_form_isactive pprops_F))
    (dcl_form_show pprops_F)
  )
  (princ)
)


(defun c:pprops_F_OnDocActivated (/) (dcl_form_close pprops_F))


(defun c:pprops_F_OnEnteringNoDocState (/) (dcl_form_close pprops_F))


(defun c:pprops_F_OnInitialize (/ nRow)
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "First"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 18)
           (dcl_grid_setcelldroplist
             pprops_F_grd
             nRow
             1
             (list "Option A" "Option B" "Option C" "Option D" "Option E" "Option F")
           )
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Option A")
           ;;      
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Second"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 18)
           (dcl_grid_setcelldroplist pprops_F_grd
                                     nRow
                                     1
                                     (list "Option 11" "Option 12" "Option 13" "Option 14")
           )
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Third"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 1)
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Set Third ON")
           (dcl_grid_setcellstyle pprops_F_grd nRow 2 30)
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Another"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 1)
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Set Another")
           (dcl_grid_setcellstyle pprops_F_grd nRow 2 31)
    )
  )
)

(defun c:pprops_F_OnSize (nWidth nHeight / keywidth)
  (setq KeyWidth 70
        nWidth   (fix (* (- nWidth 24 KeyWidth) 0.5))
  )
  (dcl_grid_setcolumnwidth pprops_F_grd 0 KeyWidth)
  (dcl_grid_setcolumnwidth pprops_F_grd 1 nWidth)
  (dcl_grid_setcolumnwidth pprops_F_grd 2 nWidth)
)




Refer video.
« Last Edit: January 06, 2010, 01:03:59 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #3 on: January 06, 2010, 01:28:47 AM »
To Set the Toggles, try something like this at initialisation.

Note the 'Third' and 'Another' settings using ( dcl_grid_setcelltext .....

Code: [Select]

(defun c:pprops_F_OnInitialize (/ nRow)
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "First"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 18)
           (dcl_grid_setcelldroplist
             pprops_F_grd
             nRow
             1
             (list "Option A" "Option B" "Option C" "Option D" "Option E" "Option F")
           )
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Option A")
           ;;     
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Second"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 18)
           (dcl_grid_setcelldroplist pprops_F_grd
                                     nRow
                                     1
                                     (list "Option 11" "Option 12" "Option 13" "Option 14")
           )
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Third"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 1)
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Set Third ON")
           (dcl_grid_setcellstyle pprops_F_grd nRow 2 30)
           (dcl_grid_setcelltext pprops_F_grd nRow 2 "13")
    )
  )
  (if (setq nRow (dcl_grid_addstring pprops_F_grd "Another"))
    (progn (dcl_grid_setcellstyle pprops_F_grd nRow 1 1)
           (dcl_grid_setcelltext pprops_F_grd nRow 1 "Set Another")
           (dcl_grid_setcellcheckstate pprops_F_grd nRow 1 1)         ; <Row [as Long]> <Column [as Long]> <State [as Integer]>
           ;;
           (dcl_grid_setcellstyle pprops_F_grd nRow 2 31)
           (dcl_grid_setcelltext pprops_F_grd nRow 2 "208,212,119")
    )
  )
)

I'll have a play with  (dcl_Grid_FillList .... tonight

See Attachment piccy for result
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8702
  • AKA Daniel
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #4 on: January 06, 2010, 02:16:40 AM »
 Nice 8-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #5 on: January 06, 2010, 03:21:41 AM »
Thanks Dan.

Here's how to do the full setup at initialisation using (dcl_Grid_FillList .....

;; NOTE: The quantity of DesignTime Columns must  match or exceed the runtime column count

Firstly the Resize Event Handler

This version keeps the Field Column the same size and proportionally allocates width to the remaining columns.
  
Code: [Select]
(defun c:pprops_F_OnSize (nWidth nHeight / keywidth)
  (setq KeyWidth 70
        nWidth   (fix (/ (- nWidth 24 KeyWidth) 5.0))
  )
  (dcl_grid_setColumnWidth pprops_F_grd 0 KeyWidth)
  (dcl_grid_setColumnWidth pprops_F_grd 1 (* 2 nWidth))
  (dcl_grid_setColumnWidth pprops_F_grd 2 nWidth)
  (dcl_grid_setColumnWidth pprops_F_grd 3 (* 2 nWidth))
)

Now the initialisation :

Code: [Select]


(defun c:pprops_F_OnInitialize (/ nRow)
  ;; NOTE: The quantity of strings in the List MUST be equal
  ;;or less than DesignTime Column quantity
  (dcl_control_setColumnWidthList pprops_F_grd (list 70 40 20 20))
  (dcl_control_setColumnCaptionList pprops_F_grd (list "Field" "Name" "Hide" "Color"))
  ;;
  ;; assume initially each column is the same 'Style'
  ;; ie each Row column 3 is style 31 <Truecolor>
  (dcl_control_setColumnStyleList pprops_F_grd (list 0 0 1 31))
  ;;
  ;;
  (dcl_Grid_FillList pprops_F_grd
                     (list
                       (list "Row1 Field"
                             "Row1 Name"  
                             ""
                             "212,119" )
                       (list "Row2 Field"
                             "Row2 Name"  
                             ""  
                             "56,168,105" )
                       (list "Row3 Field"
                             "Row3 Name"  
                             ""
                             "55,70,169" )

                       )
   )
   ;; NOW, set the Option Toggles
   (foreach nRow '( 0 2)
     ;; toggle on for nominated row
     (dcl_grid_setcellcheckstate pprops_F_grd nRow 2 1)
   )
)

and the Piccy Attachment of the Pallete immediately after initialisation:

« Last Edit: January 06, 2010, 04:22:22 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

grrrr

  • Guest
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #6 on: January 06, 2010, 04:07:31 AM »
thanks kerry, thanks dan

for your detailed reply
i will try the newer version, send a working sample
and keep you in track about it

thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #7 on: January 06, 2010, 04:09:57 AM »

You're most welcome :)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

grrrr

  • Guest
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #8 on: January 08, 2010, 02:10:40 PM »
hello,
i have stripped my problems to a sample.
the problem with color has gone with version 6.0.0.18
my problem with checkbox comes from the boxes are not direct driven by the label.
the labeltext has to be translated to checkstate an vice versa.
all date who should be acad types have to be translated.

- there are additional problems with calculating the columnwidth on that acadtype styles
  because they are solved by pulldowns( except colortype) and containing a image.
- on lineweight version 6.0.0.18 has problems. the dialog hung and must be escaped.
- if you click an acadtype button the previous value is lost.
- ...GRID1_OnButtonClicked is not called by button click.


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DCL_GRID, columntype 30 or 31 and opendcl 6.0.0.16
« Reply #9 on: January 08, 2010, 06:40:38 PM »
hello,
i have stripped my problems to a sample.
< .. >

As you have also posted this at the OpenDCL Forum, I'll assume you want it addressed there rather than here.
.... and as this is a different issue, I'll post there.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.