PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Cedric on October 16, 2024, 11:21:25 PM

Title: Calendar in grid input?
Post by: Cedric on October 16, 2024, 11:21:25 PM
Hi all,

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

Title: Re: Calendar in grid input?
Post by: Jane Raymond on October 17, 2024, 08:58:52 AM
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.
Title: Re: Calendar in grid input?
Post by: Cedric on October 17, 2024, 02:43:52 PM
Ok, and what about a non NOMAD program ?
Title: Re: Calendar in grid input?
Post by: pmpenchoff on October 18, 2024, 08:54:16 AM
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
 
Title: Re: Calendar in grid input?
Post by: Jane Raymond on October 21, 2024, 10:26:25 AM
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