Calendar in grid input?

Started by Cedric, October 16, 2024, 11:21:25 PM

Previous topic - Next topic

Cedric

Hi all,

I was wondering if there was a way to use the "calendar" function within a cell in a grid? 


Jane Raymond

Yes. In the grid presets set the Property to 'Query", set your Column and Row to specify the cells to be affected, and click the query button in the Value/Expression cell  to set the Query Display. The Query Type would be Panel, the library would be *win/calendar.* and the panel would be CALENDAR.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

Cedric

Ok, and what about a non NOMAD program ?

pmpenchoff

https://manual.pvxplus.com/PXPLUS/properties/query.htm

There's a plethora of info in the on-line help. This link refers specifically to the query definition property of a cell.

Cheers
 

Jane Raymond

#4
Here's a sample non-nomads program that creates a grid with cells that use a calendar query:
 
PRINT 'CS',
  mygrid=1000
  GRID mygrid,@(20,12,40,10)
  mygrid'columnswide=3,mygrid'rowshigh=5
  mygrid'row=0
  mygrid'colno=0,mygrid'columnwidth=10
  mygrid'colno=1,mygrid'celltype$="lookup" ! can edit cell
  mygrid'colno=2,mygrid'celltype$="query" ! cannot edit cell
  WHILE 1
  OBTAIN (0,SIZ=1)'ME',*,'MN'
  IF CTL=-1999 OR CTL=4 \
  THEN BREAK ! X or ESC
  IF CTL=mygrid \
  THEN GRID READ mygrid,mycol,myrow,myVal$,myEOM$;
        IF mycol<3 AND myEOM$=$FF$ \
        THEN GOSUB Do_Calendar \
        ELSE MSGBOX myVal$,"Value" ! the EOM for the lookup/query button is $FF$
  WEND
  END
!
Do_Calendar:
  PROCESS "Calendar","*win/calendar.en",myVal$
  GRID LOAD mygrid,mycol,myrow,myVal$+SEP
  RETURN
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.