Author Topic: ListView and Alignment  (Read 431 times)

velasquez

  • Sr. Member
  • ****
  • Posts: 493
ListView and Alignment
« on: March 05, 2019, 06:16:41 AM »
I've worked with the ListView.lsp and ListView.odcl files from the OpenDCL Studio samples to test the alignment of the images in ListView.

The problem is that I could not "CENTRALIZE" the images in a column, I used column 1 to test.
Here is the part of the .lsp file I modified and an image showing the problem.
Can someone please help me with this?

[code]
;|

Nima2018

  • Member
  • *
  • Posts: 6
Re: ListView and Alignment
« Reply #1 on: March 05, 2019, 08:46:09 AM »

Hi  velasquez,

I have not used ListView in OPENDCL control so far,But in the grid control I've used the following code repeatedly :

Code: [Select]

; use this in OnInitialize method

(DCL-GRID-ADDCOLUMNS
    My_Project/Form1/Grid1
    (LIST (LIST "  NO  " 1 20)
  (LIST "  X  " 1 70)
  (LIST "  Y  " 1 80)
  (LIST "  Z  " 1 40)
  (LIST "  L  " 1 40)
  (LIST "  CODE  " 1 20)
  (LIST "  XX  " 1 70)
  (LIST "  YY  " 1 80)
    ) ;_ end of list
  ) ;_ end of dcl-Grid-AddColumns
  (DCL-CONTROL-SETCOLUMNALIGNMENTLIST
    My_Project/Form1/Grid1
    (LIST 1 1 1 1 1 1 1 1)
  ) ;_ end of dcl-Control-SetColumnAlignmentList


Try, maybe it will help !

velasquez

  • Sr. Member
  • ****
  • Posts: 493
Re: ListView and Alignment
« Reply #2 on: March 05, 2019, 12:19:23 PM »

Hi  velasquez,

I have not used ListView in OPENDCL control so far,But in the grid control I've used the following code repeatedly :

Code: [Select]

; use this in OnInitialize method

(DCL-GRID-ADDCOLUMNS
    My_Project/Form1/Grid1
    (LIST (LIST "  NO  " 1 20)
  (LIST "  X  " 1 70)
  (LIST "  Y  " 1 80)
  (LIST "  Z  " 1 40)
  (LIST "  L  " 1 40)
  (LIST "  CODE  " 1 20)
  (LIST "  XX  " 1 70)
  (LIST "  YY  " 1 80)
    ) ;_ end of list
  ) ;_ end of dcl-Grid-AddColumns
  (DCL-CONTROL-SETCOLUMNALIGNMENTLIST
    My_Project/Form1/Grid1
    (LIST 1 1 1 1 1 1 1 1)
  ) ;_ end of dcl-Control-SetColumnAlignmentList


Try, maybe it will help !

Thanks Nima, with Grid Control works fine, I did not understand the ListView control.

roy_043

  • Sr. Member
  • ****
  • Posts: 361
Re: ListView and Alignment
« Reply #3 on: March 06, 2019, 08:35:23 AM »
As far as I can tell the alignment is only applied to the text.

velasquez

  • Sr. Member
  • ****
  • Posts: 493
Re: ListView and Alignment
« Reply #4 on: March 06, 2019, 10:02:53 AM »
As far as I can tell the alignment is only applied to the text.

Thanks Roy
I believed that the alignment was for the entire contents of the cell.
For me the effect of this separation is very strange.
I'll try to work with Grid Control