ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: grid conditional formating   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

mar. 19 mars 2013, 16h24
jcriv
France France

atoutfox.public.association

Re: grid conditional formating

Salut,

Si tu n'as pas beaucoup de shapes à afficher, tu peux utiliser dynamicCurrentControl. Un petit prg exemple :

CREATE CURSOR _Tmp (id N(1))
INSERT INTO _Tmp (id) VALUES (1)
INSERT INTO _Tmp (id) VALUES (2)
INSERT INTO _Tmp (id) VALUES (3)
INSERT INTO _Tmp (id) VALUES (4)
INSERT INTO _Tmp (id) VALUES (5)
INSERT INTO _Tmp (id) VALUES (1)
INSERT INTO _Tmp (id) VALUES (2)
GO TOP

PUBLIC ofrm

ofrm=CREATEOBJECT("frm")
ofrm.Show
RETURN


DEFINE CLASS sh1 AS shape
  BackColor = RGB(255,255,128)
ENDDEFINE
DEFINE CLASS sh2 AS shape
  BackColor = RGB(0,255,128)
ENDDEFINE
DEFINE CLASS sh3 AS shape
  BackColor = RGB(255,128,0)
ENDDEFINE
DEFINE CLASS sh4 AS shape
  BackColor = RGB(0,0,255)
ENDDEFINE

DEFINE CLASS frm AS form
  Name = "Frm"
  ADD OBJECT grd AS grid WITH ;
    ColumnCount = 2, ;
    DeleteMark = .F., ;
    Height = 200, ;
    RecordSource = "_Tmp", ;
    Width = 200, ;
    Name = "Grd", ;
    Column1.ControlSource = "_Tmp.id"

  PROCEDURE init
    ThisForm.grd.Column2.AddObject("sh1", "sh1")
    ThisForm.grd.Column2.AddObject("sh2", "sh2")
    ThisForm.grd.Column2.AddObject("sh3", "sh3")
    ThisForm.grd.Column2.AddObject("sh4", "sh4")
    ThisForm.grd.Column2.Sparse = .F.
    ThisForm.grd.Column2.DynamicCurrentControl = 'icase(_tmp.id = 1, "sh1", _Tmp.id=2, "sh2", _tmp.id = 3, "sh3", _tmp.id = 4, "sh4", "")'
  RETURN
ENDDEFINE


Cordialement,

JC

Permalink : http://www.atoutfox.org/nntp.asp?ID=0000011605
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3