Quoi, tu ne connais pas PB ? Va falloir parcourir tout le forum alors !

Le forum (ô combien francophone) des utilisateurs de Powerbuilder.

Recherche rapide

Annonce

Certaines rubriques, dont des cours, sont uniquement visibles par les membres du forum ^^.
Dans la rubrique Liens & Références, vous avez accès à un sommaire de téléchargement, profitez-en !
Il existe maintenant un nouveau TOPIC "Votre CV en Ligne" accessible uniquement par demande.

#1 10-10-2007 09:23:04

sebdec  
Membre Geek
Lieu: Boulogne Billancourt
Date d'inscription: 23-04-2007
Messages: 21
Pépites: 84
Banque: 0

Les graphes sous PB

Bonjour à tous!

J'utilise PowerBuilder depuis quelques mois maintenant, et je dois intégrer un module à mon application présentant des graphiques.
J'ai donc insére un nouvele Objet de type Graphe, mais j'avoue que je patauge un peu pour l'exploiter.

Je voudrais faire quelque chose d'assez simple, présentant 2 droites (fonctionas afines du 1er degré) et 2 points dessus.
Quelqu'un a-t-il déjà eu à faire ce genre de chose ou connaissez-vous un tuto expliquant les techniques de graphe sous PB?
Merci d'avance à vous tous!

(J'ai fait une recherche sur le forum mais je n'ai pas trouvé de topic traitant les graphes, j'espère n'être pas passé à côté)

Bonne journée

Hors ligne

 

#2 10-10-2007 09:29:30

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB

voici une petite fenetre ...

Code: pb

forward
global type w_graph_perf_modif from window
end type
type ddlb_fonts from dropdownlistbox within w_graph_perf_modif
end type
type ddlb_font_size from dropdownlistbox within w_graph_perf_modif
end type
type lb_value from listbox within w_graph_perf_modif
end type
type lb_category from listbox within w_graph_perf_modif
end type
type rb_sans_serie from radiobutton within w_graph_perf_modif
end type
type rb_avec_serie from radiobutton within w_graph_perf_modif
end type
type st_6 from statictext within w_graph_perf_modif
end type
type sle_title from singlelineedit within w_graph_perf_modif
end type
type gb_1 from groupbox within w_graph_perf_modif
end type
type st_5 from statictext within w_graph_perf_modif
end type
type st_4 from statictext within w_graph_perf_modif
end type
type em_spacing from editmask within w_graph_perf_modif
end type
type ddlb_legende from dropdownlistbox within w_graph_perf_modif
end type
type uo_graph_3d from u_graph_3d within w_graph_perf_modif
end type
type em_series from editmask within w_graph_perf_modif
end type
type cb_cancel from commandbutton within w_graph_perf_modif
end type
type uo_color_select from u_color_selection within w_graph_perf_modif
end type
type cb_ok from commandbutton within w_graph_perf_modif
end type
type gb_2 from groupbox within w_graph_perf_modif
end type
type rb_series_foreground from radiobutton within w_graph_perf_modif
end type
type rb_series_background from radiobutton within w_graph_perf_modif
end type
type rb_graph_background from radiobutton within w_graph_perf_modif
end type
type rb_graph_textcolor from radiobutton within w_graph_perf_modif
end type
type gb_3 from groupbox within w_graph_perf_modif
end type
type gb_4 from groupbox within w_graph_perf_modif
end type
type gb_police from groupbox within w_graph_perf_modif
end type
end forward

global type w_graph_perf_modif from window
integer x = 375
integer y = 252
integer width = 2135
integer height = 1336
boolean titlebar = true
string title = "Paramètre du graphe"
boolean resizable = true
windowtype windowtype = response!
long backcolor = 74481808
toolbaralignment toolbaralignment = alignatleft!
ddlb_fonts ddlb_fonts
ddlb_font_size ddlb_font_size
lb_value lb_value
lb_category lb_category
rb_sans_serie rb_sans_serie
rb_avec_serie rb_avec_serie
st_6 st_6
sle_title sle_title
gb_1 gb_1
st_5 st_5
st_4 st_4
em_spacing em_spacing
ddlb_legende ddlb_legende
uo_graph_3d uo_graph_3d
em_series em_series
cb_cancel cb_cancel
uo_color_select uo_color_select
cb_ok cb_ok
gb_2 gb_2
rb_series_foreground rb_series_foreground
rb_series_background rb_series_background
rb_graph_background rb_graph_background
rb_graph_textcolor rb_graph_textcolor
gb_3 gb_3
gb_4 gb_4
gb_police gb_police
end type
global w_graph_perf_modif w_graph_perf_modif

type variables
graph igr_parm
datawindow idw_parm
datawindow idw_parm_save
string is_series_name
long il_backcolor, il_textcolor, il_serbackcolor []
long il_serforecolor []
long il_seriescount
object io_passed

int ii_original_spacing
int ii_original_legend
long il_elevation
long il_rotation
long il_perspective

string is_original_title
String is_series

nvo_fonts  inc_Fonts
DataStore  ids_Fonts

end variables

forward prototypes
public subroutine wf_set_a_series (string as_title, string as_value, string as_category)
private subroutine wf_set_font ()
end prototypes

public subroutine wf_set_a_series (string as_title, string as_value, string as_category);//long ll_row, ll_index
end subroutine

private subroutine wf_set_font ();
String    ls_font
Integer    li_size

If Not IsNull(ddlb_fonts.text) And ddlb_fonts.text <> "" Then
  ls_font = ddlb_fonts.text
Else
  ls_font = "Arial"
End if
If IsNull(ls_font) Or ls_font = "" Then ls_font = "Arial"

idw_parm.Object.gr_1.title.dispattr.font.face = ls_font
idw_parm.Object.gr_1.legend.dispattr.font.face = ls_font
idw_parm.Object.gr_1.pie.dispattr.font.face = ls_font
idw_parm.Object.gr_1.series.dispattr.font.face = ls_font
idw_parm.Object.gr_1.series.labeldispattr.font.face = ls_font
idw_parm.Object.gr_1.category.dispattr.font.face = ls_font
idw_parm.Object.gr_1.category.labeldispattr.font.face = ls_font
idw_parm.Object.gr_1.values.dispattr.font.face = ls_font
idw_parm.Object.gr_1.values.labeldispattr.font.face = ls_font

If Not IsNull(ddlb_font_size.text) And ddlb_font_size.text <> "" Then
  li_size = Integer(ddlb_font_size.text)
Else
  li_size = 10
End if

idw_parm.Object.gr_1.title.dispattr.autosize = 0
idw_parm.Object.gr_1.legend.dispattr.autosize = 0
idw_parm.Object.gr_1.pie.dispattr.autosize = 0
idw_parm.Object.gr_1.series.dispattr.autosize = 0
idw_parm.Object.gr_1.series.labeldispattr.autosize = 0
idw_parm.Object.gr_1.category.dispattr.autosize = 0
idw_parm.Object.gr_1.category.labeldispattr.autosize = 0
idw_parm.Object.gr_1.values.dispattr.autosize = 0
idw_parm.Object.gr_1.values.labeldispattr.autosize = 0

idw_parm.Object.gr_1.title.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.legend.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.pie.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.series.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.series.labeldispattr.font.Height = - li_size
idw_parm.Object.gr_1.category.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.category.labeldispattr.font.Height = - li_size
idw_parm.Object.gr_1.values.dispattr.font.Height = - li_size
idw_parm.Object.gr_1.values.labeldispattr.font.Height = - li_size

// Fin MCC - 18/02/2005

end subroutine

event open;//This will change the color of a graph that was passed in the message.powerobjectparm
//The graph may be in a datawindow or a graph object in a window.

//There are two sections of changes depending if the object passed
//was a graph or datawindow

int     li_index
long    ll_gr_color
string  ls_series_name 
Long    ll_row, ll_i

//get the object and test what type of object was passed
//the type of object will be stored in io_passed

graphicobject lgro_hold
lgro_hold =  message.powerobjectparm


// MCC - 18/02/2005
// Chargement de la liste des polices
inc_Fonts = CREATE nvo_fonts
ids_Fonts = inc_Fonts.of_GetFont()

ids_Fonts.setsort("font_family")
ids_Fonts.sort()

If ids_Fonts.RowCount() > 0 Then
  For ll_i = 1 To ids_Fonts.RowCount()
    ddlb_fonts.insertitem(ids_Fonts.GetItemString(ll_i, "font_family"), ll_i)
  Next
End if

// Fin MCC - 18/02/2005


//graph object was passed ?
If lgro_hold.TypeOf( ) = Graph! Then
  io_passed = Graph!
  igr_parm = message.powerobjectparm

  //set the series spin control
  //allow modifing multiple series within a graph
  il_seriescount = igr_parm.SeriesCount()


  //keep a copy of the graph for the cancel button
  il_backcolor = igr_parm.backcolor 
  il_textcolor = igr_parm.textcolor 
  For li_index = 1 to il_seriescount
    is_series_name = igr_parm.SeriesName (li_index)    
    igr_parm.getSeriesStyle ( is_series_name, background!, il_serbackcolor[li_index])
    igr_parm.getSeriesStyle ( is_series_name, foreground!, il_serforecolor[li_index])
  Next

  // Set the color selector user object to the series foreground color,
  // since that radio button starts out selected.
  is_series_name = igr_parm.SeriesName (1)
  igr_parm.getseriesstyle (is_series_name,foreground!, ll_gr_color)


//datawindow object was passed
Elseif lgro_hold.TypeOf( ) = Datawindow! Then
  io_passed = datawindow!
  idw_parm = message.powerobjectparm
  idw_parm_save = message.powerobjectparm
  //set the series spin control
  //allow modifing multiple series within a graph
  il_seriescount = idw_parm.SeriesCount("gr_1")

  //keep a copy of the graph for the cancel button
  string ls_backcolor, ls_textcolor
  ls_backcolor = idw_parm.Object.gr_1.backcolor
  ls_textcolor = idw_parm.Object.gr_1.color
  il_backcolor = long(ls_backcolor)
  il_textcolor = long(ls_textcolor)
  For li_index = 1 to il_seriescount
    is_series_name = idw_parm.SeriesName ("gr_1", li_index)    
    idw_parm.getSeriesStyle ( "gr_1",is_series_name, background!, il_serbackcolor[li_index])
    idw_parm.getSeriesStyle ( "gr_1",is_series_name, foreground!, il_serforecolor[li_index])
  Next

  // Set the color selector user object to the series foreground color,
  // since that radio button starts out selected.
  is_series_name = idw_parm.SeriesName ("gr_1",1)
  idw_parm.getseriesstyle ("gr_1", is_series_name, foreground!, ll_gr_color)
  
  // MCC - 18/02/2005
  // Sélection de la police et de la taille du graphe
  If IsNull(idw_parm.Object.gr_1.series.dispattr.font.face) Or &
     idw_parm.Object.gr_1.series.dispattr.font.face = "" Then
    ddlb_fonts.Selectitem("Arial", 0)
  Else
    ddlb_fonts.Selectitem(idw_parm.Object.gr_1.series.dispattr.font.face, 0)
  End if
  If Integer(idw_parm.Object.gr_1.series.dispattr.font.Height) < 0 Then
    ddlb_font_size.Selectitem(String(- Integer(idw_parm.Object.gr_1.series.dispattr.font.Height)), 0)
  ElseIf Integer(idw_parm.Object.gr_1.series.dispattr.font.Height) = 0 Then
    ddlb_font_size.Selectitem("12", 0)
  Else
    ddlb_font_size.Selectitem(idw_parm.Object.gr_1.series.dispattr.font.Height, 0)
  End if
  // Fin MCC - 18/02/2005
End If

//modify the minmax of the series counter
If il_seriescount > 1 Then
  em_series.minmax = "1~~" + String(il_seriescount)
  em_series.enabled = true
End If

//set the color bar to the this foreground graph color
uo_color_select.uf_set_rgb (ll_gr_color)


If io_passed = Graph! Then 
  em_spacing.text = string(igr_parm.spacing)
  ii_original_spacing = igr_parm.spacing

Elseif lgro_hold.TypeOf() = Datawindow! Then
  em_spacing.text = idw_parm.Object.gr_1.spacing
  ii_original_spacing = Integer(em_spacing.text)
  ddlb_legende.SelectItem(long( idw_parm.Object.gr_1.legend ) + 1 )
End If


If io_passed = Graph! Then 
  il_elevation = igr_parm.elevation 
  il_rotation = igr_parm.rotation 
  il_perspective = igr_parm.perspective 
  
Elseif io_passed = datawindow! Then 


  il_seriescount = idw_parm.SeriesCount("gr_1")

  string ls_elevation, ls_rotation, ls_perspective

  ls_elevation = idw_parm.Object.gr_1.elevation
  ls_rotation = idw_parm.Object.gr_1.rotation
  ls_perspective = idw_parm.Object.gr_1.perspective

  il_elevation = long(ls_elevation)
  il_rotation = long(ls_rotation)
  il_perspective = long(ls_perspective)
End If

uo_graph_3d.uf_set_perspective (il_perspective)
uo_graph_3d.uf_set_rotation (il_rotation)
uo_graph_3d.uf_set_elevation (il_elevation)

If io_passed = Graph! Then 
  sle_title.text = igr_parm.title
  sle_title.SelectText (1,999)
  
  // Remember the original title, in case they cancel
  is_original_title = igr_parm.title
Elseif io_passed = Datawindow! Then 
  sle_title.text = idw_parm.Object.gr_1.title
  sle_title.SelectText (1,999)

  is_original_title = sle_title.text
End If


If io_passed = Graph! Then
  SetNull(is_series)
  rb_avec_serie.Enabled = False
  rb_sans_serie.Enabled = False
Elseif io_passed = Datawindow! Then  
  is_series = idw_parm.Object.gr_1.series
  If IsNull(is_series) or is_series ='' or is_series ='?' or is_series = "~"noseries ~" "  Then 
    rb_avec_serie.Enabled = False
    rb_sans_serie.Enabled = False
  End if
End if


end event

on w_graph_perf_modif.create
this.ddlb_fonts=create ddlb_fonts
this.ddlb_font_size=create ddlb_font_size
this.lb_value=create lb_value
this.lb_category=create lb_category
this.rb_sans_serie=create rb_sans_serie
this.rb_avec_serie=create rb_avec_serie
this.st_6=create st_6
this.sle_title=create sle_title
this.gb_1=create gb_1
this.st_5=create st_5
this.st_4=create st_4
this.em_spacing=create em_spacing
this.ddlb_legende=create ddlb_legende
this.uo_graph_3d=create uo_graph_3d
this.em_series=create em_series
this.cb_cancel=create cb_cancel
this.uo_color_select=create uo_color_select
this.cb_ok=create cb_ok
this.gb_2=create gb_2
this.rb_series_foreground=create rb_series_foreground
this.rb_series_background=create rb_series_background
this.rb_graph_background=create rb_graph_background
this.rb_graph_textcolor=create rb_graph_textcolor
this.gb_3=create gb_3
this.gb_4=create gb_4
this.gb_police=create gb_police
this.Control[]={this.ddlb_fonts,&
this.ddlb_font_size,&
this.lb_value,&
this.lb_category,&
this.rb_sans_serie,&
this.rb_avec_serie,&
this.st_6,&
this.sle_title,&
this.gb_1,&
this.st_5,&
this.st_4,&
this.em_spacing,&
this.ddlb_legende,&
this.uo_graph_3d,&
this.em_series,&
this.cb_cancel,&
this.uo_color_select,&
this.cb_ok,&
this.gb_2,&
this.rb_series_foreground,&
this.rb_series_background,&
this.rb_graph_background,&
this.rb_graph_textcolor,&
this.gb_3,&
this.gb_4,&
this.gb_police}
end on

on w_graph_perf_modif.destroy
destroy(this.ddlb_fonts)
destroy(this.ddlb_font_size)
destroy(this.lb_value)
destroy(this.lb_category)
destroy(this.rb_sans_serie)
destroy(this.rb_avec_serie)
destroy(this.st_6)
destroy(this.sle_title)
destroy(this.gb_1)
destroy(this.st_5)
destroy(this.st_4)
destroy(this.em_spacing)
destroy(this.ddlb_legende)
destroy(this.uo_graph_3d)
destroy(this.em_series)
destroy(this.cb_cancel)
destroy(this.uo_color_select)
destroy(this.cb_ok)
destroy(this.gb_2)
destroy(this.rb_series_foreground)
destroy(this.rb_series_background)
destroy(this.rb_graph_background)
destroy(this.rb_graph_textcolor)
destroy(this.gb_3)
destroy(this.gb_4)
destroy(this.gb_police)
end on

event close;
DESTROY inc_Fonts


end event

type ddlb_fonts from dropdownlistbox within w_graph_perf_modif
integer x = 928
integer y = 68
integer width = 521
integer height = 528
integer taborder = 30
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
boolean hscrollbar = true
boolean vscrollbar = true
borderstyle borderstyle = stylelowered!
end type

type ddlb_font_size from dropdownlistbox within w_graph_perf_modif
integer x = 1472
integer y = 68
integer width = 169
integer height = 352
integer taborder = 30
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
boolean allowedit = true
boolean sorted = false
boolean vscrollbar = true
string item[] = {"8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72"}
borderstyle borderstyle = stylelowered!
end type

type lb_value from listbox within w_graph_perf_modif
boolean visible = false
integer x = 1065
integer y = 1232
integer width = 663
integer height = 368
integer taborder = 120
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 41943040
boolean vscrollbar = true
boolean multiselect = true
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;
end event

type lb_category from listbox within w_graph_perf_modif
boolean visible = false
integer x = 306
integer y = 1232
integer width = 663
integer height = 368
integer taborder = 110
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 41943040
long backcolor = 74481808
boolean enabled = false
boolean vscrollbar = true
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;
end event

type rb_sans_serie from radiobutton within w_graph_perf_modif
integer x = 480
integer y = 76
integer width = 320
integer height = 64
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "sans série"
end type

event clicked;If io_passed = Graph! Then
  idw_parm.Object.gr_1.series  = '~'noseries ~''
Elseif io_passed = Datawindow! Then  
  idw_parm.Modify("gr_1.series = '~"noseries ~" ' ")

End if

end event

type rb_avec_serie from radiobutton within w_graph_perf_modif
integer x = 105
integer y = 76
integer width = 343
integer height = 64
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "avec série"
boolean checked = true
end type

event clicked;If Not IsNull(is_series) Then  
  If io_passed = Graph! Then
//    igr_parm.series  = is_series
  Elseif io_passed = Datawindow! Then  
    idw_parm.Modify("gr_1.series = '"+is_series+"' ")
    idw_parm.GroupCalc()
  End if
End if 

end event

type st_6 from statictext within w_graph_perf_modif
integer x = 73
integer y = 1032
integer width = 352
integer height = 52
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "Titre du graphe "
boolean focusrectangle = false
end type

type sle_title from singlelineedit within w_graph_perf_modif
integer x = 73
integer y = 1108
integer width = 1934
integer height = 84
integer taborder = 100
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
integer limit = 999
borderstyle borderstyle = stylelowered!
end type

event modified;If io_passed = Graph! Then
  igr_parm.title = this.text
Elseif io_passed = Datawindow! Then
  // Set the graph title in the datawindow to the modified text.
  idw_parm.Object.gr_1.title = this.text
End If
end event

type gb_1 from groupbox within w_graph_perf_modif
integer x = 901
integer y = 172
integer width = 759
integer height = 480
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
end type

type st_5 from statictext within w_graph_perf_modif
integer x = 78
integer y = 744
integer width = 434
integer height = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "Espacement (en %):"
boolean focusrectangle = false
end type

type st_4 from statictext within w_graph_perf_modif
integer x = 78
integer y = 848
integer width = 343
integer height = 52
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "Legende"
boolean focusrectangle = false
end type

type em_spacing from editmask within w_graph_perf_modif
event ue_enchange pbm_enchange
integer x = 512
integer y = 744
integer width = 297
integer height = 72
integer taborder = 70
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
string mask = "#####"
boolean spin = true
end type

event ue_enchange;///////////////////////////////////////////////////////////////////////////////////////////////////////
// ue_enchange script for em_spacing
///////////////////////////////////////////////////////////////////////////////////////////////////////
String  ls_spacing

If io_passed = Graph! Then
  ls_spacing = em_spacing.text
  If IsNull(em_spacing.text) Then em_spacing.text = '0'
  
  igr_parm.spacing = integer (em_spacing.text)
Elseif io_passed = Datawindow! Then
  ls_spacing = em_spacing.text
  If IsNull(em_spacing.text) Then em_spacing.text = '0'
  
  idw_parm.Object.gr_1.spacing = em_spacing.text
//  idw_parm.SetDataPieExplode("gr_1",1,1,Integer(em_spacing.text))
End If

end event

type ddlb_legende from dropdownlistbox within w_graph_perf_modif
integer x = 512
integer y = 840
integer width = 297
integer height = 324
integer taborder = 90
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
boolean sorted = false
string item[] = {"Sans","Gauche","Droite","Haut","Base"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;grLegendType grl_type

If index > 0 and index < 6 Then
  choose case index
  case 1
    grl_type = NoLegend!
  case 2
    grl_type = AtLeft!
  case 3
    grl_type = AtRight!
  case 4
    grl_type = AtTop!
    
  case 5
    grl_type = AtBottom!
  end choose

  If io_passed = Graph! Then
    igr_parm.legend = grl_type
  Elseif io_passed = Datawindow! Then
    idw_parm.Object.gr_1.legend = string(index -1 )
  End If
End if 
  
end event

type uo_graph_3d from u_graph_3d within w_graph_perf_modif
integer x = 901
integer y = 684
integer width = 1106
integer height = 320
integer taborder = 40
borderstyle borderstyle = stylelowered!
end type

event td_changed;call super::td_changed;string ls_new_color
long ll_color_hold

//graph
If io_passed = Graph! Then
  igr_parm.setredraw(false)
  igr_parm.perspective = uo_graph_3d.uf_get_perspective()
  igr_parm.rotation = uo_graph_3d.uf_get_rotation()
  igr_parm.elevation = uo_graph_3d.uf_get_elevation()
  igr_parm.setredraw(true)

//datawindow
Elseif io_passed = Datawindow! Then
  idw_parm.setredraw(false)
  idw_parm.Object.gr_1.perspective = uo_graph_3d.uf_get_perspective()
  idw_parm.Object.gr_1.rotation = uo_graph_3d.uf_get_rotation()
  idw_parm.Object.gr_1.elevation = uo_graph_3d.uf_get_elevation()
  idw_parm.setredraw(true)
End If


end event

on uo_graph_3d.destroy
call u_graph_3d::destroy
end on

type em_series from editmask within w_graph_perf_modif
event ue_emchanged pbm_enchange
integer x = 1769
integer y = 520
integer width = 183
integer height = 100
integer taborder = 120
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
boolean enabled = false
string text = "1"
boolean displayonly = true
borderstyle borderstyle = stylelowered!
string mask = "###,###."
boolean spin = true
double increment = 1
string minmax = "1~~1"
end type

on ue_emchanged;//Get new series name

If io_passed = Graph! Then
  is_series_name = igr_parm.SeriesName (integer(em_series.text))
Elseif io_passed = Datawindow! Then
  is_series_name = idw_parm.SeriesName ("gr_1", integer(em_series.text))
End If

If rb_series_background.checked Then rb_series_background.TriggerEvent("clicked")
If rb_series_foreground.checked Then rb_series_foreground.TriggerEvent("clicked")

end on

type cb_cancel from commandbutton within w_graph_perf_modif
integer x = 1719
integer y = 324
integer width = 297
integer height = 100
integer taborder = 100
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string text = "Annuler"
boolean cancel = true
end type

event clicked;// Restore the 4 changable colors to their original color

//There are two sections of changes depending if the object passed
//was a graph or datawindow
int li_index

If io_passed = Graph! Then
  igr_parm.Setredraw (false)
  igr_parm.backcolor = il_backcolor
  igr_parm.textcolor = il_textcolor

  //cycle thru the series restoring each attribute of the series
  For li_index = 1 to il_seriescount
    is_series_name = igr_parm.SeriesName(li_index)
    igr_parm.SetSeriesStyle ( is_series_name, background!, il_serbackcolor[li_index])
    igr_parm.SetSeriesStyle ( is_series_name, foreground!, il_serforecolor[li_index])
  Next
  igr_parm.Setredraw (true)
Elseif io_passed = Datawindow! Then
  idw_parm.Setredraw (false)
  idw_parm.Object.gr_1.backcolor = string(il_backcolor)
  idw_parm.Object.gr_1.color = string(il_textcolor)
  
  //cycle thru the series restoring each attribute of the series
  For li_index = 1 to il_seriescount
    is_series_name = idw_parm.SeriesName("gr_1",li_index)
    idw_parm.SetSeriesStyle ( "gr_1", is_series_name, background!,il_serbackcolor[li_index])
    idw_parm.SetSeriesStyle ( "gr_1", is_series_name, foreground!,il_serforecolor[li_index])
  Next
  idw_parm.Setredraw (true)
End if



Close (parent)
end event

type uo_color_select from u_color_selection within w_graph_perf_modif
integer x = 64
integer y = 200
integer taborder = 60
borderstyle borderstyle = stylelowered!
end type

event color_changed;call u_color_selection::color_changed;string ls_new_color
long ll_color_hold

//There are two sections of changes depending if the object passed
//was a graph or datawindow
// When the color is changed, change the appropriate color in the
// graph, depending on which radio button is checked currently.

//graph
If io_passed = Graph! Then
  igr_parm.setredraw(false)

  //find out which attribute to change 
  If rb_graph_background.checked then
    igr_parm.backcolor = uo_color_select.uf_get_rgb()
  Elseif rb_graph_textcolor.checked then
    igr_parm.textcolor = uo_color_select.uf_get_rgb()
  Elseif rb_series_background.checked then
    igr_parm.SetSeriesStyle ( is_series_name, background!,& 
                    uo_color_select.uf_get_rgb())
  Elseif rb_series_foreground.checked then
    igr_parm.SetSeriesStyle ( is_series_name, foreground!,& 
                    uo_color_select.uf_get_rgb())
  End If
  igr_parm.setredraw(true)

//datawindow
Elseif io_passed = Datawindow! Then
  
  idw_parm.setredraw(false)

  //get new color
  ls_new_color = string (uo_color_select.uf_get_rgb())

  //find out which attribute to change 
  If rb_graph_background.checked then
    idw_parm.Object.gr_1.backcolor = ls_new_color
    
  Elseif rb_graph_textcolor.checked then

    idw_parm.getSeriesStyle ( "gr_1", is_series_name, background!, ll_color_hold)
    idw_parm.Object.gr_1.color = ls_new_color
    idw_parm.setredraw(true)
    idw_parm.SetSeriesStyle ( "gr_1", is_series_name, background!,  ll_color_hold)
    idw_parm.setredraw(false)

  Elseif rb_series_background.checked then
    idw_parm.SetSeriesStyle ( "gr_1", is_series_name, background!,& 
                    uo_color_select.uf_get_rgb())
  Elseif rb_series_foreground.checked then
    idw_parm.SetSeriesStyle ( "gr_1", is_series_name, foreground!,& 
                    uo_color_select.uf_get_rgb())
  End If 
  idw_parm.setredraw(true)
End If
end event

on uo_color_select.destroy
call u_color_selection::destroy
end on

type cb_ok from commandbutton within w_graph_perf_modif
integer x = 1719
integer y = 204
integer width = 297
integer height = 100
integer taborder = 80
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string text = "OK"
boolean default = true
end type

event clicked;//If IsValid(w_recherche_perf) Then
//  wf_set_font()
//  w_recherche_perf.TriggerEvent('ue_save_graph')
//End IF
Close (parent)
end event

type gb_2 from groupbox within w_graph_perf_modif
integer x = 1719
integer y = 452
integer width = 293
integer height = 196
integer taborder = 110
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
string text = "Series #"
end type

type rb_series_foreground from radiobutton within w_graph_perf_modif
integer x = 946
integer y = 260
integer width = 645
integer height = 72
integer taborder = 10
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
string text = "Series Fill "
boolean checked = true
end type

event clicked;long ll_grcolor

// Get this color type from the graph and set the color in the color
// selector user object.

//There are two sections of changes depending if the object passed
//was a graph or datawindow
em_series.enabled = True
If io_passed = Graph! Then
  igr_parm.getseriesstyle (is_series_name,foreground!, ll_grcolor)
Elseif io_passed = Datawindow! Then
  idw_parm.getseriesstyle ("gr_1", is_series_name, foreground!, ll_grcolor)
End if

uo_color_select.uf_set_rgb (ll_grcolor)

end event

type rb_series_background from radiobutton within w_graph_perf_modif
integer x = 937
integer y = 348
integer width = 645
integer height = 72
integer taborder = 20
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
string text = "Series Outline "
end type

event clicked;long ll_grcolor

// Get this color type from the graph and set the color in the color
// selector user object.

//There are two sections of changes depending if the object passed
//was a graph or datawindow
em_series.enabled = True
If io_passed = Graph! Then
  igr_parm.getseriesstyle (is_series_name,background!, ll_grcolor)
Elseif io_passed = Datawindow! Then
  idw_parm.getseriesstyle ("gr_1", is_series_name,background!, ll_grcolor)
End if
uo_color_select.uf_set_rgb (ll_grcolor)

end event

type rb_graph_background from radiobutton within w_graph_perf_modif
integer x = 937
integer y = 436
integer width = 663
integer height = 72
integer taborder = 30
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
string text = "Graph Background"
end type

event clicked;// Get this color type from the graph and set the color in the color
// selector user object.
//There are two sections of changes depending if the object passed
//was a graph or datawindow

string ls_backcolor
em_series.enabled = False
If io_passed = Graph! Then
  uo_color_select.uf_set_rgb (igr_parm.backcolor)
Elseif io_passed = Datawindow! Then
  ls_backcolor = idw_parm.Object.gr_1.backcolor
  uo_color_select.uf_set_rgb (long(ls_backcolor))
End If
end event

type rb_graph_textcolor from radiobutton within w_graph_perf_modif
integer x = 937
integer y = 524
integer width = 645
integer height = 72
integer taborder = 50
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 74481808
string text = "Graph Gridlines"
end type

event clicked;// Get this color type from the graph and set the color in the color
// selector user object.

//There are two sections of changes depending if the object passed
//was a graph or datawindow

string ls_color
em_series.enabled = False
If io_passed = Graph! Then
  uo_color_select.uf_set_rgb (igr_parm.textcolor)
Elseif io_passed = Datawindow! Then
  ls_color = idw_parm.Object.gr_1.color
  uo_color_select.uf_set_rgb (Long(ls_color))
End if
end event

type gb_3 from groupbox within w_graph_perf_modif
integer x = 64
integer y = 660
integer width = 768
integer height = 348
integer taborder = 50
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
end type

type gb_4 from groupbox within w_graph_perf_modif
integer x = 64
integer y = 12
integer width = 754
integer height = 156
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
end type

type gb_police from groupbox within w_graph_perf_modif
integer x = 901
integer y = 12
integer width = 759
integer height = 156
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
string text = "Police"
end type

Face à l'agression, la puissance de l'intelligence

Hors ligne

 

#3 10-10-2007 09:34:05

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB

et des user objects

Code: pb

forward
global type u_graph_3d from userobject
end type
type st_elevation from statictext within u_graph_3d
end type
type st_rotation from statictext within u_graph_3d
end type
type st_perspectve from statictext within u_graph_3d
end type
type hsb_rotation from hscrollbar within u_graph_3d
end type
type hsb_perspective from hscrollbar within u_graph_3d
end type
type hsb_elevation from hscrollbar within u_graph_3d
end type
end forward

global type u_graph_3d from userobject
integer width = 1138
integer height = 328
boolean border = true
long backcolor = 78682240
long tabtextcolor = 33554432
event td_changed pbm_custom01
st_elevation st_elevation
st_rotation st_rotation
st_perspectve st_perspectve
hsb_rotation hsb_rotation
hsb_perspective hsb_perspective
hsb_elevation hsb_elevation
end type
global u_graph_3d u_graph_3d

type variables
long   ii_p, ii_r, ii_e
end variables

forward prototypes
public function long uf_get_rotation ()
public function long uf_get_elevation ()
public function long uf_get_perspective ()
public subroutine uf_set_rotation (long al_position)
public subroutine uf_set_perspective (long al_position)
public subroutine uf_set_elevation (long al_position)
end prototypes

public function long uf_get_rotation ();return ii_r
end function

public function long uf_get_elevation ();return ii_e
end function

public function long uf_get_perspective ();return ii_p
end function

public subroutine uf_set_rotation (long al_position);ii_r = al_position
hsb_rotation.position = ii_r

end subroutine

public subroutine uf_set_perspective (long al_position);ii_p = al_position
hsb_perspective.position = ii_p

end subroutine

public subroutine uf_set_elevation (long al_position);ii_e = al_position
hsb_elevation.position = ii_e
end subroutine

on u_graph_3d.create
this.st_elevation=create st_elevation
this.st_rotation=create st_rotation
this.st_perspectve=create st_perspectve
this.hsb_rotation=create hsb_rotation
this.hsb_perspective=create hsb_perspective
this.hsb_elevation=create hsb_elevation
this.Control[]={this.st_elevation,&
this.st_rotation,&
this.st_perspectve,&
this.hsb_rotation,&
this.hsb_perspective,&
this.hsb_elevation}
end on

on u_graph_3d.destroy
destroy(this.st_elevation)
destroy(this.st_rotation)
destroy(this.st_perspectve)
destroy(this.hsb_rotation)
destroy(this.hsb_perspective)
destroy(this.hsb_elevation)
end on

type st_elevation from statictext within u_graph_3d
integer x = 32
integer y = 208
integer width = 238
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 78682240
boolean enabled = false
string text = "Elevation :"
boolean focusrectangle = false
end type

type st_rotation from statictext within u_graph_3d
integer x = 32
integer y = 112
integer width = 219
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 78682240
boolean enabled = false
string text = "Rotation :"
boolean focusrectangle = false
end type

type st_perspectve from statictext within u_graph_3d
integer x = 32
integer y = 20
integer width = 293
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 78682240
boolean enabled = false
string text = "Perspective :"
boolean focusrectangle = false
end type

type hsb_rotation from hscrollbar within u_graph_3d
integer x = 393
integer y = 116
integer width = 654
integer height = 64
integer taborder = 30
integer maxposition = 99
end type

event pageright;if ii_r > 60 then
  ii_r = 99
else
  ii_r = ii_r + 39
end if

this.position = ii_r
parent.TriggerEvent ("td_changed")
end event

event lineleft;if ii_r < 10 then
  ii_r = 0
else
  ii_r = ii_r - 10
end if

this.position = ii_r
parent.TriggerEvent ('td_changed')
end event

event lineright;if ii_r > 89 then
  ii_r = 99
else
  ii_r = ii_r + 10
end if

this.position = ii_r
parent.TriggerEvent ("td_changed")
end event

event moved;
ii_r = this.position
parent.TriggerEvent ('td_changed')
end event

event pageleft;if ii_r < 39 then
  ii_r = 0
else
  ii_r = ii_r - 39
end if

this.position = ii_r
parent.TriggerEvent ("td_changed")
end event

type hsb_perspective from hscrollbar within u_graph_3d
integer x = 393
integer y = 24
integer width = 654
integer height = 64
integer taborder = 10
integer maxposition = 99
end type

event lineright;if ii_p > 89 then
  ii_p = 99
else
  ii_p = ii_p + 10
end if

this.position = ii_p
parent.TriggerEvent ("td_changed")
end event

event pageleft;if ii_p < 39 then
  ii_p = 0
else
  ii_p = ii_p - 39
end if

this.position = ii_p
parent.TriggerEvent ("td_changed")
end event

event lineleft;if ii_p < 10 then
  ii_p = 0
else
  ii_p = ii_p - 10
end if

this.position = ii_p
parent.TriggerEvent ('td_changed')
end event

event moved;ii_p = this.position

parent.TriggerEvent ('td_changed')
end event

event pageright;if ii_p > 60 then
  ii_p = 99
else
  ii_p = ii_p + 39
end if

this.position = ii_p

parent.TriggerEvent ("td_changed")
end event

type hsb_elevation from hscrollbar within u_graph_3d
integer x = 393
integer y = 212
integer width = 654
integer height = 64
integer taborder = 50
integer maxposition = 99
end type

event pageright;if ii_e > 60 then
  ii_e = 99
else
  ii_e = ii_e + 39
end if

this.position = ii_e
parent.TriggerEvent ("td_changed")
end event

event lineleft;if ii_e < 10 then
  ii_e = 0
else
  ii_e = ii_e - 10
end if

this.position = ii_e
parent.TriggerEvent ('td_changed')
end event

event lineright;if ii_e > 90 then
  ii_e = 99
else
  ii_e = ii_e + 10
end if

this.position = ii_e
parent.TriggerEvent ("td_changed")
end event

event moved;ii_e = this.position

parent.TriggerEvent ('td_changed')
end event

event pageleft;if ii_e < 39 then
  ii_e = 0
else
  ii_e = ii_e - 39
end if

this.position = ii_e
parent.TriggerEvent ("td_changed")
end event


Code: pb

forward
global type u_graph_gallery from userobject
end type
type p_gallery from picture within u_graph_gallery
end type
type st_1 from statictext within u_graph_gallery
end type
type cb_ok from commandbutton within u_graph_gallery
end type
type cb_cancel from commandbutton within u_graph_gallery
end type
type mle_1 from multilineedit within u_graph_gallery
end type
end forward

global type u_graph_gallery from userobject
integer width = 2217
integer height = 1100
boolean border = true
long backcolor = 78682240
long tabtextcolor = 33554432
event gallery_ok pbm_custom01
event gallery_cancel pbm_custom02
p_gallery p_gallery
st_1 st_1
cb_ok cb_ok
cb_cancel cb_cancel
mle_1 mle_1
end type
global u_graph_gallery u_graph_gallery

type variables
Integer  ii_Row = 0, ii_Col = 0
String  is_GraphType

end variables

forward prototypes
public function integer uf_query_gallery (ref integer ai_row, ref integer ai_col, ref string as_type)
end prototypes

public function integer uf_query_gallery (ref integer ai_row, ref integer ai_col, ref string as_type);// integer Function UF_QUERY_GALLERY (int a_row, int a_col)

//  Returns current values of ui_row and ui_col 
// in ai_Row and ai_Col, respectively

// Returns +1 if current row and column are valid, 0 if not valid

ai_Row = ii_Row
ai_Col = ii_Col

If ii_Row = 2 And ii_Col = 6 Then
  Return 0    
ElseIf ii_Row < 1 Or ii_Col < 1 Then
  Return 0
Else
  as_Type = is_GraphType
  Return 1
End If

end function

event constructor;p_gallery.width = mle_1.width - 20
p_gallery.height = mle_1.height - 20

end event

on u_graph_gallery.create
this.p_gallery=create p_gallery
this.st_1=create st_1
this.cb_ok=create cb_ok
this.cb_cancel=create cb_cancel
this.mle_1=create mle_1
this.Control[]={this.p_gallery,&
this.st_1,&
this.cb_ok,&
this.cb_cancel,&
this.mle_1}
end on

on u_graph_gallery.destroy
destroy(this.p_gallery)
destroy(this.st_1)
destroy(this.cb_ok)
destroy(this.cb_cancel)
destroy(this.mle_1)
end on

type p_gallery from picture within u_graph_gallery
integer x = 23
integer y = 40
integer width = 1792
integer height = 992
boolean originalsize = true
string picturename = "U:\Commun\Roulcomp\RESOURCE\grgallry1.bmp"
end type

event clicked;// Clicked script for P_GALLERY

Constant Integer    iCOLWIDTH = 287, iROWHEIGHT = 308
Integer  li_X, li_Y, li_TextX, li_TextY
String  ls_Title, &
      ls_Titles1[6] = {"Aire", "Barre", "Colonne", "Ligne", "Secteur", "Point"}, &
      ls_Titles3[6] = {"Barre", "Colonne", "Barre", "Colonne", "Barre", "Colonne"}, &
      ls_GraphType[6,3] = { &
        "areagraph","bargraph","colgraph","linegraph","piegraph","scattergraph",&
        "area3d","bar3dgraph","col3dgraph","line3d","pie3d","error",&
        "barstackgraph","colstackgraph","bar3dobjgraph","col3dobjgraph",&
        "barstack3dobjgraph","colstack3dobjgraph"}            

li_X = This.PointerX()
li_Y = This.PointerY()
If li_X < 25 or li_X > 1747 or li_Y < 30 or li_Y > 954 Then
  st_1.Hide()
  Beep(1)
  Return
End If

ii_Col = ((li_X - 25) / iCOLWIDTH) + 1
ii_Row = ((li_Y - 30) / iROWHEIGHT) + 1

If ii_Row = 3 Then
  ls_Title = ls_Titles3[ii_Col]
Else
  ls_Title = ls_Titles1[ii_Col]
End If

li_TextY = (ii_Row * iROWHEIGHT) + ((ii_Row - 1) * 10)

st_1.Text = ls_Title
//li_TextX = This.x + ((ii_Col - 1) * iCOLWIDTH) + 75
li_TextX = This.x + ((ii_Col - 1) * iCOLWIDTH) + 45

li_TextY = li_TextY - This.y

st_1.Hide ()
If ii_Row = 2 And ii_Col = 6 Then
  Beep (1)      // Only 5 entries in Row 2 (no 3D Scatter)
Else
  st_1.Move (li_TextX, li_TextY)
  st_1.Show ()
End If

is_GraphType = ls_GraphType[ii_Col, ii_Row]

end event

on doubleclicked;TriggerEvent (cb_ok, clicked!)
end on

type st_1 from statictext within u_graph_gallery
boolean visible = false
integer x = 1861
integer y = 860
integer width = 251
integer height = 68
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 16777215
long backcolor = 8388608
boolean enabled = false
string text = "none"
alignment alignment = center!
end type

type cb_ok from commandbutton within u_graph_gallery
integer x = 1911
integer y = 80
integer width = 261
integer height = 108
integer taborder = 20
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string text = "OK"
boolean default = true
end type

on clicked;// Clicked script for CB_OK

Parent.TriggerEvent ("gallery_ok")
end on

type cb_cancel from commandbutton within u_graph_gallery
integer x = 1911
integer y = 216
integer width = 261
integer height = 108
integer taborder = 10
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string text = "Annuler"
boolean cancel = true
end type

on clicked;// Clicked script for CB_CANCEL

Parent.TriggerEvent ("gallery_cancel")
end on

type mle_1 from multilineedit within u_graph_gallery
integer x = 9
integer y = 32
integer width = 1815
integer height = 1008
integer taborder = 30
integer textsize = -8
integer weight = 700
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 16777215
borderstyle borderstyle = stylelowered!
end type


Code: pb

forward
global type u_color_selection from userobject
end type
type st_3 from statictext within u_color_selection
end type
type st_2 from statictext within u_color_selection
end type
type st_1 from statictext within u_color_selection
end type
type hsb_green from hscrollbar within u_color_selection
end type
type hsb_red from hscrollbar within u_color_selection
end type
type sle_blue from singlelineedit within u_color_selection
end type
type sle_green from singlelineedit within u_color_selection
end type
type sle_red from singlelineedit within u_color_selection
end type
type hsb_blue from hscrollbar within u_color_selection
end type
type rr_1 from roundrectangle within u_color_selection
end type
end forward

global type u_color_selection from userobject
integer width = 754
integer height = 460
boolean border = true
long backcolor = 78682240
long tabtextcolor = 33554432
event color_changed pbm_custom01
st_3 st_3
st_2 st_2
st_1 st_1
hsb_green hsb_green
hsb_red hsb_red
sle_blue sle_blue
sle_green sle_green
sle_red sle_red
hsb_blue hsb_blue
rr_1 rr_1
end type
global u_color_selection u_color_selection

type variables
int   ii_r, ii_g, ii_b
end variables

forward prototypes
public subroutine uf_set_rgb (long al_rgb)
public function long uf_get_rgb ()
end prototypes

public subroutine uf_set_rgb (long al_rgb);//////////////////////////////////////////////////////////////////////
//
// Function: uf_set_rgb
//
// Purpose: initialize the RGB values on this user object to the
//        long value that is passed to this function
//
//  Scope: public
//
//  Arguments: al_rgb    the RGB value that you want to use to set
//                the RGB values on this user object
//
//  Returns: none
//
//////////////////////////////////////////////////////////////////////

// set the red color value
ii_r = Mod (al_rgb, 256)
al_rgb = al_rgb / 256

// set the green color value
ii_g = Mod (al_rgb, 256)
al_rgb = al_rgb / 256

// set the blue color value
ii_b = Mod (al_rgb, 256)

// set the fill color on the 'test color palette' to the current RGB value
rr_1.fillcolor = rgb (ii_r, ii_g, ii_b)

// set the horizontal scrollbars to the correct positions
hsb_red.position = ii_r
hsb_green.position = ii_g
hsb_blue.position = ii_b

// set the red, green, and blue text values to the correct values.
sle_red.text = String (ii_r)
sle_green.text = String (ii_g)
sle_blue.text = String (ii_b)


end subroutine

public function long uf_get_rgb ();//////////////////////////////////////////////////////////////////////
//
// Function: uf_get_rgb
//
// Purpose: returns the current RGB value for this user object
//
//  Scope: public
//
//  Arguments: none  
//
//  Returns: long    the current RGB value for this user object
//
//////////////////////////////////////////////////////////////////////

return RGB (ii_r, ii_g, ii_b)
end function

on u_color_selection.create
this.st_3=create st_3
this.st_2=create st_2
this.st_1=create st_1
this.hsb_green=create hsb_green
this.hsb_red=create hsb_red
this.sle_blue=create sle_blue
this.sle_green=create sle_green
this.sle_red=create sle_red
this.hsb_blue=create hsb_blue
this.rr_1=create rr_1
this.Control[]={this.st_3,&
this.st_2,&
this.st_1,&
this.hsb_green,&
this.hsb_red,&
this.sle_blue,&
this.sle_green,&
this.sle_red,&
this.hsb_blue,&
this.rr_1}
end on

on u_color_selection.destroy
destroy(this.st_3)
destroy(this.st_2)
destroy(this.st_1)
destroy(this.hsb_green)
destroy(this.hsb_red)
destroy(this.sle_blue)
destroy(this.sle_green)
destroy(this.sle_red)
destroy(this.hsb_blue)
destroy(this.rr_1)
end on

type st_3 from statictext within u_color_selection
integer x = 32
integer y = 324
integer width = 183
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 16711680
long backcolor = 78682240
boolean enabled = false
string text = "Bleu :"
boolean focusrectangle = false
end type

type st_2 from statictext within u_color_selection
integer x = 32
integer y = 228
integer width = 183
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 65280
long backcolor = 78682240
boolean enabled = false
string text = "Vert :"
boolean focusrectangle = false
end type

type st_1 from statictext within u_color_selection
integer x = 32
integer y = 136
integer width = 183
integer height = 72
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 255
long backcolor = 78682240
boolean enabled = false
string text = "Rouge :"
boolean focusrectangle = false
end type

type hsb_green from hscrollbar within u_color_selection
integer x = 393
integer y = 232
integer width = 311
integer height = 44
integer taborder = 30
integer maxposition = 255
end type

on pageright;//////////////////////////////////////////////////////////////////////
// increment the green color value by 50
//////////////////////////////////////////////////////////////////////

if ii_g > 205 then
  ii_g = 255
else
  ii_g = ii_g + 50
end if
sle_green.text = String (ii_g)
this.position = ii_g

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on lineleft;/////////////////////////////////////////////////////////////////////
// Decrement the green color value by 10
/////////////////////////////////////////////////////////////////////

if ii_g < 10 then
  ii_g = 0
else
  ii_g = ii_g - 10
end if
sle_green.text = String (ii_g)
this.position = ii_g
rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)

parent.TriggerEvent ('color_changed')
end on

on lineright;//////////////////////////////////////////////////////////////////////
// increment the green color value by 10
//////////////////////////////////////////////////////////////////////

if ii_g > 245 then
  ii_g = 255
else
  ii_g = ii_g + 10
end if
sle_green.text = String (ii_g)
this.position = ii_g

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on moved;/////////////////////////////////////////////////////////////////////
// Change the green color value based on current position of scrollbar
/////////////////////////////////////////////////////////////////////

ii_g = this.position
sle_green.text = String (ii_g)

// Change the test palette color
rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ('color_changed')
end on

on pageleft;//////////////////////////////////////////////////////////////////////
// Decrement the green color value by 50
//////////////////////////////////////////////////////////////////////

if ii_g < 50 then
  ii_g = 0
else
  ii_g = ii_g - 50
end if
sle_green.text = String (ii_g)
this.position = ii_g

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

type hsb_red from hscrollbar within u_color_selection
integer x = 393
integer y = 140
integer width = 311
integer height = 44
integer taborder = 10
integer maxposition = 255
end type

on lineright;//////////////////////////////////////////////////////////////////////
// increment the red color value by 10
//////////////////////////////////////////////////////////////////////

if ii_r > 245 then
  ii_r = 255
else
  ii_r = ii_r + 10
end if
sle_red.text = String (ii_r)
this.position = ii_r

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on pageleft;//////////////////////////////////////////////////////////////////////
// Decrement the red color value by 50
//////////////////////////////////////////////////////////////////////

if ii_r < 50 then
  ii_r = 0
else
  ii_r = ii_r - 50
end if
sle_red.text = String (ii_r)
this.position = ii_r

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on lineleft;/////////////////////////////////////////////////////////////////////
// Decrement the red color value by 10
/////////////////////////////////////////////////////////////////////

if ii_r < 10 then
  ii_r = 0
else
  ii_r = ii_r - 10
end if
sle_red.text = String (ii_r)
this.position = ii_r
rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)

parent.TriggerEvent ('color_changed')
end on

on moved;/////////////////////////////////////////////////////////////////////
// Change the red color value based on current position of scrollbar
/////////////////////////////////////////////////////////////////////

ii_r = this.position
sle_red.text = String (ii_r)

// Change the test palette color
rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ('color_changed')
end on

on pageright;//////////////////////////////////////////////////////////////////////
// increment the red color value by 50
//////////////////////////////////////////////////////////////////////

if ii_r > 205 then
  ii_r = 255
else
  ii_r = ii_r + 50
end if
sle_red.text = String (ii_r)
this.position = ii_r

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

type sle_blue from singlelineedit within u_color_selection
integer x = 224
integer y = 324
integer width = 151
integer height = 72
integer taborder = 60
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string pointer = "arrow!"
long textcolor = 16777215
long backcolor = 16711680
string text = "0"
boolean autohscroll = false
borderstyle borderstyle = stylelowered!
end type

on getfocus;// select the text when this single line edit get focus

this.SelectText (1, LenA (this.text))
end on

on modified;//////////////////////////////////////////////////////////////////////
// Change the blue color value based on the data entered
//////////////////////////////////////////////////////////////////////

int  li_new_value


if IsNumber (this.text) then
  li_new_value = Integer (this.text)
  if li_new_value < 0 or li_new_value > 255 then
    Beep (1)
    this.text = String (ii_b)
  else
    ii_b = li_new_value
    rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
    hsb_blue.position = ii_b
    parent.TriggerEvent ("color_changed")
  end if
else
  Beep (1)
  this.text = String (ii_b)
end if


end on

type sle_green from singlelineedit within u_color_selection
integer x = 224
integer y = 228
integer width = 151
integer height = 76
integer taborder = 40
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string pointer = "arrow!"
long textcolor = 16777215
long backcolor = 65280
string text = "0"
boolean autohscroll = false
borderstyle borderstyle = stylelowered!
end type

on getfocus;// select the text when this single line edit get focus

this.SelectText (1, LenA (this.text))
end on

on modified;//////////////////////////////////////////////////////////////////////
// Change the green color value based on the data entered
//////////////////////////////////////////////////////////////////////

int  li_new_value


if IsNumber (this.text) then
  li_new_value = Integer (this.text)
  if li_new_value < 0 or li_new_value > 255 then
    Beep (1)
    this.text = String (ii_g)
  else
    ii_g = li_new_value
    rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
    hsb_green.position = ii_g
    parent.TriggerEvent ("color_changed")
  end if
else
  Beep (1)
  this.text = String (ii_g)
end if


end on

type sle_red from singlelineedit within u_color_selection
integer x = 224
integer y = 136
integer width = 151
integer height = 76
integer taborder = 20
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
string pointer = "arrow!"
long textcolor = 16777215
long backcolor = 255
string text = "0"
boolean autohscroll = false
borderstyle borderstyle = stylelowered!
end type

on getfocus;// select the text when this single line edit get focus

this.SelectText (1, LenA (this.text))
end on

on modified;//////////////////////////////////////////////////////////////////////
// Change the red color value based on the data entered
//////////////////////////////////////////////////////////////////////

int  li_new_value


if IsNumber (this.text) then
  li_new_value = Integer (this.text)
  if li_new_value < 0 or li_new_value > 255 then
    Beep (1)
    this.text = String (ii_r)
  else
    ii_r = li_new_value
    rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
    hsb_red.position = ii_r
    parent.TriggerEvent ("color_changed")
  end if
else
  Beep (1)
  this.text = String (ii_r)
end if


end on

type hsb_blue from hscrollbar within u_color_selection
integer x = 389
integer y = 328
integer width = 311
integer height = 44
integer taborder = 50
integer maxposition = 255
end type

on pageright;//////////////////////////////////////////////////////////////////////
// increment the blue color value by 50
//////////////////////////////////////////////////////////////////////

if ii_b > 205 then
  ii_b = 255
else
  ii_b = ii_b + 50
end if
sle_blue.text = String (ii_b)
this.position = ii_b

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on lineleft;/////////////////////////////////////////////////////////////////////
// Decrement the blue color value by 10
/////////////////////////////////////////////////////////////////////

if ii_b < 10 then
  ii_b = 0
else
  ii_b = ii_b - 10
end if
sle_blue.text = String (ii_b)
this.position = ii_b

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ('color_changed')
end on

on lineright;//////////////////////////////////////////////////////////////////////
// increment the blue color value by 10
//////////////////////////////////////////////////////////////////////

if ii_b > 245 then
  ii_b = 255
else
  ii_b = ii_b + 10
end if
sle_blue.text = String (ii_b)
this.position = ii_b

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

on moved;/////////////////////////////////////////////////////////////////////
// Change the blue color value based on current position of scrollbar
/////////////////////////////////////////////////////////////////////

ii_b = this.position
sle_blue.text = String (ii_b)

// Change the test palette color
rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ('color_changed')
end on

on pageleft;//////////////////////////////////////////////////////////////////////
// Decrement the blue color value by 50
//////////////////////////////////////////////////////////////////////

if ii_b < 50 then
  ii_b = 0
else
  ii_b = ii_b - 50
end if
sle_blue.text = String (ii_b)
this.position = ii_b

rr_1.fillcolor = RGB (ii_r, ii_g, ii_b)
parent.TriggerEvent ("color_changed")
end on

type rr_1 from roundrectangle within u_color_selection
long linecolor = 1090519039
integer linethickness = 4
long fillcolor = 16777215
integer x = 224
integer y = 24
integer width = 274
integer height = 76
integer cornerheight = 445
integer cornerwidth = 40
end type

Face à l'agression, la puissance de l'intelligence

Hors ligne

 

#4 10-10-2007 09:41:37

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB


Face à l'agression, la puissance de l'intelligence

Hors ligne

 

#5 10-10-2007 09:44:00

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB

Code: pb

forward
global type w_graph_perf_type from window
end type
type uo_graph_gallery from u_graph_gallery within w_graph_perf_type
end type
end forward

global type w_graph_perf_type from window
integer width = 2263
integer height = 1204
boolean titlebar = true
string title = "Choix du graph"
boolean controlmenu = true
windowtype windowtype = response!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
uo_graph_gallery uo_graph_gallery
end type
global w_graph_perf_type w_graph_perf_type

type variables
graph igr_parm
datawindow idw_parm
object io_passed


end variables

on w_graph_perf_type.create
this.uo_graph_gallery=create uo_graph_gallery
this.Control[]={this.uo_graph_gallery}
end on

on w_graph_perf_type.destroy
destroy(this.uo_graph_gallery)
end on

event open;// Receive and remember in the igr_parm or idw_parm instance variable, the
// object that has been passed by the window that opened this.

graphicobject lgro_hold

lgro_hold = message.powerobjectparm

If lgro_hold.TypeOf() = Graph! Then
  io_passed = Graph!
  igr_parm = message.powerobjectparm
Elseif lgro_hold.TypeOf() = Datawindow! Then
  io_passed = Datawindow!
  idw_parm = message.powerobjectparm
End If


end event

type uo_graph_gallery from u_graph_gallery within w_graph_perf_type
integer x = 41
integer y = 68
boolean border = false
long backcolor = 74481808
end type

event gallery_ok;call super::gallery_ok;int li_col,li_row, li_ret
string ls_graph_type, ls_graphtype


// Get the graph type from the graph gallery user object.
li_ret = uf_query_gallery (li_row, li_col, ls_graph_type)
if li_ret = 0 then
  messagebox ("Désolé!","Vous avez cliqué sur un type de graphe invalide ")
  return
end if


If io_passed = Graph! Then
  // The user clicked on a graph type. Set the type in the passed graph
  // object.
  Choose Case ls_graph_type
    case "area3d"
      igr_parm.graphtype = area3d!
    case "areagraph"
      igr_parm.graphtype = areagraph!
    case "bar3dobjgraph"
      igr_parm.graphtype = bar3dobjgraph!
    case "barstack3dobjgraph"
      igr_parm.graphtype = barstack3dobjgraph!
    case "bargraph"
      igr_parm.graphtype = bargraph!
    case "bar3dgraph"
      igr_parm.graphtype = bar3dgraph!
    case "barstackgraph"
      igr_parm.graphtype = barstackgraph!
    case "col3dgraph"
      igr_parm.graphtype = col3dgraph!
    case "col3dobjgraph"
      igr_parm.graphtype = col3dobjgraph!
    case "colgraph"
      igr_parm.graphtype = colgraph!
    case "colstack3dobjgraph"
      igr_parm.graphtype = colstack3dobjgraph!
    case "colstackgraph"
      igr_parm.graphtype = colstackgraph!
    case "line3d"
      igr_parm.graphtype = line3d!
    case "linegraph"
      igr_parm.graphtype = linegraph!
    case "pie3d"
      igr_parm.graphtype = pie3d!
    case "piegraph"
      igr_parm.graphtype = piegraph!
    case "scattergraph"
      igr_parm.graphtype = scattergraph!
    case else
      messagebox ("Error!", "Type de graphe invalide")
  end choose
Elseif io_passed = Datawindow! Then
  ls_graphtype = idw_parm.Object.gr_1.graphtype
  IF ls_graphtype = '17' or ls_graphtype = '13' Then 
    Choose Case ls_graph_type
      case "pie3d"
        idw_parm.Object.gr_1.graphtype = 17
      case "piegraph"
        idw_parm.Object.gr_1.graphtype = 13
      case else
        messagebox ("Error !", "Vous ne pouvez pas selectionner un graphe de type autre que secteur !")
    end choose
    
  Else 
    Choose Case ls_graph_type
      case "area3d"
        idw_parm.Object.gr_1.graphtype = 15
      case "areagraph"
        idw_parm.Object.gr_1.graphtype = 1
      case "bar3dobjgraph"
        idw_parm.Object.gr_1.graphtype = 4
      case "barstack3dobjgraph"
        idw_parm.Object.gr_1.graphtype = 6
      case "bargraph"
        idw_parm.Object.gr_1.graphtype = 2
      case "bar3dgraph"
        idw_parm.Object.gr_1.graphtype = 3
      case "barstackgraph"
        idw_parm.Object.gr_1.graphtype = 5
        case "col3dgraph"
        idw_parm.Object.gr_1.graphtype = 8
      case "col3dobjgraph"
        idw_parm.Object.gr_1.graphtype = 9
      case "colgraph"
        idw_parm.Object.gr_1.graphtype = 7
      case "colstack3dobjgraph"
        idw_parm.Object.gr_1.graphtype = 11
      case "colstackgraph"
        idw_parm.Object.gr_1.graphtype = 10
      case "line3d"
        idw_parm.Object.gr_1.graphtype = 16
      case "linegraph"
        idw_parm.Object.gr_1.graphtype = 12
      case "scattergraph"
        idw_parm.Object.gr_1.graphtype = 14
      case else
        messagebox ("Error !", "Vous ne pouvez pas selectionner un graphe de type secteur !")
    end choose
  End if 
End If
If IsValid(w_recherche_perf) Then
  w_recherche_perf.TriggerEvent('ue_save_graph')
End IF
Close (parent)
end event

on gallery_cancel;call u_graph_gallery::gallery_cancel;Close (parent)

end on

on uo_graph_gallery.destroy
call u_graph_gallery::destroy
end on

Face à l'agression, la puissance de l'intelligence

Hors ligne

 

#6 10-10-2007 09:51:48

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB

un bout de code pour modifier la Syntax de la DW

Code: pb

choose case ii_GRAPHTYPE
      case 13, 17
        // Modification de la propriété font.pitch à 1 pour pouvoir modifier la police
        // Modification de la propriété autosize à 0 pour pouvoir modifier la taille de la police
        ls_syntax_gfx = 'graph(band=background height="2332" width="2926" graphtype="'+String(ii_GRAPHTYPE)+'" perspective="2" rotation="-20" color="0" backcolor="16777215" shadecolor="255" range= 0 border="3" overlappercent="0" spacing="100" elevation="20" depth="100"x="0" y="0" height="2332" width="2926"  name=gr_1 visible="1"  sizetodisplay=1  series="'+ls_SERIES_COLNAME+'"  category="'+ls_CATEGORY_COLNAME+'"  values="'+ls_VALEUR_COLNAME+'"  title="'+is_lbvue+'"  title.dispattr.backcolor="553648127"  title.dispattr.alignment="2"  title.dispattr.autosize="0"  title.dispattr.font.charset="0"  title.dispattr.font.escapement="0"  title.dispattr.font.face="Arial"  title.dispattr.font.family="2"  title.dispattr.font.height="0"  title.dispattr.font.italic="0"  title.dispattr.font.orientation="0"  title.dispattr.font.pitch="1"  title.dispattr.font.strikethrough="0"  title.dispattr.font.underline="0"  title.dispattr.font.weight="700"  title.dispattr.format="[general]"  title.dispattr.textcolor="0"  title.dispattr.displayexpression="title"  legend="1"  legend.dispattr.backcolor="536870912"  legend.dispattr.alignment="0"  legend.dispattr.autosize="0"  legend.dispattr.font.charset="0"  legend.dispattr.font.escapement="0"  legend.dispattr.font.face="Arial"  legend.dispattr.font.family="2"  legend.dispattr.font.height="0"  legend.dispattr.font.italic="0"  legend.dispattr.font.orientation="0"  legend.dispattr.font.pitch="1"  legend.dispattr.font.strikethrough="0"  legend.dispattr.font.underline="0"  legend.dispattr.font.weight="400"  legend.dispattr.format="[general]"  legend.dispattr.textcolor="0"  legend.dispattr.displayexpression="category"  pie.dispattr.backcolor="536870912"  pie.dispattr.alignment="0"  pie.dispattr.autosize="0"  pie.dispattr.font.charset="0"  pie.dispattr.font.escapement="0"  pie.dispattr.font.face="Arial"  pie.dispattr.font.family="2"  pie.dispattr.font.height="0"  pie.dispattr.font.italic="0"  pie.dispattr.font.orientation="0"  pie.dispattr.font.pitch="1"  pie.dispattr.font.strikethrough="0"  pie.dispattr.font.underline="0"  pie.dispattr.font.weight="400"  pie.dispattr.format="[General]"  pie.dispattr.textcolor="0"  pie.dispattr.displayexpression="if(seriescount > 1, series,string(percentofseries,~~"0.00%~~"))" ~r~n'
        ls_syntax_gfx +=' series.autoscale="1" ~r~n'
        ls_syntax_gfx +='  series.displayeverynlabels="0"  series.droplines="0"  series.frame="1"  series.label="(None)"  series.majordivisions="0"  series.majorgridline="0"  series.majortic="3"  series.maximumvalue="0"  series.minimumvalue="0"  series.minordivisions="0"  series.minorgridline="0"  series.minortic="1"  series.originline="1"  series.primaryline="1"  series.roundto="0"  series.roundtounit="0"  series.scaletype="1"  series.scalevalue="1"  series.secondaryline="0"  series.shadebackedge="0"  series.dispattr.backcolor="536870912"  series.dispattr.alignment="0"  series.dispattr.autosize="0"  series.dispattr.font.charset="0"  series.dispattr.font.escapement="0"  series.dispattr.font.face="Arial"  series.dispattr.font.family="2"  series.dispattr.font.height="0"  series.dispattr.font.italic="0"  series.dispattr.font.orientation="0"  series.dispattr.font.pitch="1"  series.dispattr.font.strikethrough="0"  series.dispattr.font.underline="0"  series.dispattr.font.weight="400"  series.dispattr.format="[general]"  series.dispattr.textcolor="0"  series.dispattr.displayexpression="series"  series.labeldispattr.backcolor="553648127"  series.labeldispattr.alignment="2"  series.labeldispattr.autosize="0"  series.labeldispattr.font.charset="0"  series.labeldispattr.font.escapement="0"  series.labeldispattr.font.face="Arial"  series.labeldispattr.font.family="2"  series.labeldispattr.font.height="0"  series.labeldispattr.font.italic="0"  series.labeldispattr.font.orientation="0"  series.labeldispattr.font.pitch="1"  series.labeldispattr.font.strikethrough="0"  series.labeldispattr.font.underline="0"  series.labeldispattr.font.weight="400"  series.labeldispattr.format="[general]"  series.labeldispattr.textcolor="0"  series.labeldispattr.displayexpression="seriesaxislabel"  series.sort="1" ~r~n'
        ls_syntax_gfx +='  category.autoscale="1" ~r~n'
        ls_syntax_gfx +='  category.displayeverynlabels="0"  category.droplines="0"  category.frame="1"  category.label="(None)"  category.majordivisions="0"  category.majorgridline="0"  category.majortic="3"  category.maximumvalue="0"  category.minimumvalue="0"  category.minordivisions="0"  category.minorgridline="0"  category.minortic="1"  category.originline="0"  category.primaryline="1"  category.roundto="0"  category.roundtounit="0"  category.scaletype="1"  category.scalevalue="1"  category.secondaryline="0"  category.shadebackedge="1"  category.dispattr.backcolor="556870912"  category.dispattr.alignment="2"  category.dispattr.autosize="0"  category.dispattr.font.charset="0"  category.dispattr.font.escapement="0"  category.dispattr.font.face="Arial"  category.dispattr.font.family="2"  category.dispattr.font.height="0"  category.dispattr.font.italic="0"  category.dispattr.font.orientation="0"  category.dispattr.font.pitch="1"  category.dispattr.font.strikethrough="0"  category.dispattr.font.underline="0"  category.dispattr.font.weight="400"  category.dispattr.format="[general]"  category.dispattr.textcolor="0"  category.dispattr.displayexpression="category"  category.labeldispattr.backcolor="556870912"  category.labeldispattr.alignment="2"  category.labeldispattr.autosize="0"  category.labeldispattr.font.charset="0"  category.labeldispattr.font.escapement="0"  category.labeldispattr.font.face="Arial"  category.labeldispattr.font.family="2"  category.labeldispattr.font.height="0"  category.labeldispattr.font.italic="0"  category.labeldispattr.font.orientation="0"  category.labeldispattr.font.pitch="1"  category.labeldispattr.font.strikethrough="0"  category.labeldispattr.font.underline="0"  category.labeldispattr.font.weight="400"  category.labeldispattr.format="[general]"  category.labeldispattr.textcolor="0"  category.labeldispattr.displayexpression="categoryaxislabel"  category.sort="1" ~r~n'
        ls_syntax_gfx +='  values.autoscale="1" ~r~n'
        ls_syntax_gfx +='  values.displayeverynlabels="0"  values.droplines="0"  values.frame="1"  values.label="(None)"  values.majordivisions="0"  values.majorgridline="0"  values.majortic="3"  values.maximumvalue="1000"  values.minimumvalue="0"  values.minordivisions="0"  values.minorgridline="0"  values.minortic="1"  values.originline="1"  values.primaryline="1"  values.roundto="0"  values.roundtounit="0"  values.scaletype="1"  values.scalevalue="1"  values.secondaryline="0"  values.shadebackedge="0"  values.dispattr.backcolor="556870912"  values.dispattr.alignment="1"  values.dispattr.autosize="0"  values.dispattr.font.charset="0"  values.dispattr.font.escapement="0"  values.dispattr.font.face="Arial"  values.dispattr.font.family="2"  values.dispattr.font.height="0"  values.dispattr.font.italic="0"  values.dispattr.font.orientation="0"  values.dispattr.font.pitch="1"  values.dispattr.font.strikethrough="0"  values.dispattr.font.underline="0"  values.dispattr.font.weight="400"  values.dispattr.format="[General]"  values.dispattr.textcolor="0"  values.dispattr.displayexpression="value"  values.labeldispattr.backcolor="553648127"  values.labeldispattr.alignment="2"  values.labeldispattr.autosize="0"  values.labeldispattr.font.charset="0"  values.labeldispattr.font.escapement="900"  values.labeldispattr.font.face="Arial"  values.labeldispattr.font.family="2"  values.labeldispattr.font.height="0"  values.labeldispattr.font.italic="0"  values.labeldispattr.font.orientation="0"  values.labeldispattr.font.pitch="1"  values.labeldispattr.font.strikethrough="0"  values.labeldispattr.font.underline="0"  values.labeldispattr.font.weight="400"  values.labeldispattr.format="[general]"  values.labeldispattr.textcolor="0"  values.labeldispattr.displayexpression="valuesaxislabel" )~r~n'
        
      case else
        // Modification de la propriété font.pitch à 1 pour pouvoir modifier la police
        // Modification de la propriété autosize à 0 pour pouvoir modifier la taille de la police
        ls_syntax_gfx = 'graph(band=foreground height="1172" width="2533" graphtype="'+String(ii_GRAPHTYPE)+'" perspective="2" rotation="-20" color="0" backcolor="16777215" shadecolor="0" range= 0 border="0" overlappercent="0" spacing="94" elevation="20" depth="100"x="46" y="168" height="1172" width="2533"  name=gr_1 visible="1"  sizetodisplay=1  series="'+ls_SERIES_COLNAME+'"  category="'+ls_CATEGORY_COLNAME+'"  values="'+ls_VALEUR_COLNAME+'"  title="'+is_lbvue+'"  title.dispattr.backcolor="536870912"  title.dispattr.alignment="2"  title.dispattr.autosize="0"  title.dispattr.font.charset="0"  title.dispattr.font.escapement="0"  title.dispattr.font.face="Arial"  title.dispattr.font.family="2"  title.dispattr.font.height="0"  title.dispattr.font.italic="0"  title.dispattr.font.orientation="0"  title.dispattr.font.pitch="1"  title.dispattr.font.strikethrough="0"  title.dispattr.font.underline="0"  title.dispattr.font.weight="700"  title.dispattr.format="[General]"  title.dispattr.textcolor="0"  title.dispattr.displayexpression="title"  legend="4"  legend.dispattr.backcolor="536870912"  legend.dispattr.alignment="0"  legend.dispattr.autosize="0"  legend.dispattr.font.charset="0"  legend.dispattr.font.escapement="0"  legend.dispattr.font.face="Arial"  legend.dispattr.font.family="2"  legend.dispattr.font.height="0"  legend.dispattr.font.italic="0"  legend.dispattr.font.orientation="0"  legend.dispattr.font.pitch="1"  legend.dispattr.font.strikethrough="0"  legend.dispattr.font.underline="0"  legend.dispattr.font.weight="400"  legend.dispattr.format="[General]"  legend.dispattr.textcolor="0"  legend.dispattr.displayexpression="series"~r~n'
        ls_syntax_gfx +='  series.autoscale="1" ~r~n'
        ls_syntax_gfx +='  series.displayeverynlabels="0"  series.droplines="0"  series.frame="1"  series.label="'+ls_LBSERIES+'"  series.majordivisions="0"  series.majorgridline="0"  series.majortic="3"  series.maximumvalue="0"  series.minimumvalue="0"  series.minordivisions="0"  series.minorgridline="0"  series.minortic="1"  series.originline="0"  series.primaryline="1"  series.roundto="0"  series.roundtounit="0"  series.scaletype="1"  series.scalevalue="1"  series.secondaryline="0"  series.shadebackedge="0"  series.dispattr.backcolor="536870912"  series.dispattr.alignment="0"  series.dispattr.autosize="0"  series.dispattr.font.charset="0"  series.dispattr.font.escapement="0"  series.dispattr.font.face="Arial"  series.dispattr.font.family="2"  series.dispattr.font.height="0"  series.dispattr.font.italic="0"  series.dispattr.font.orientation="0"  series.dispattr.font.pitch="1"  series.dispattr.font.strikethrough="0"  series.dispattr.font.underline="0"  series.dispattr.font.weight="400"  series.dispattr.format="[General]"  series.dispattr.textcolor="0"  series.dispattr.displayexpression="series"  series.labeldispattr.backcolor="536870912"  series.labeldispattr.alignment="2"  series.labeldispattr.autosize="0"  series.labeldispattr.font.charset="0"  series.labeldispattr.font.escapement="0"  series.labeldispattr.font.face="Arial"  series.labeldispattr.font.family="2"  series.labeldispattr.font.height="0"  series.labeldispattr.font.italic="0"  series.labeldispattr.font.orientation="0"  series.labeldispattr.font.pitch="1"  series.labeldispattr.font.strikethrough="0"  series.labeldispattr.font.underline="0"  series.labeldispattr.font.weight="400"  series.labeldispattr.format="[General]"  series.labeldispattr.textcolor="0"  series.labeldispattr.displayexpression="seriesaxislabel"  series.sort="1" ~r~n'
        ls_syntax_gfx +='  category.autoscale="1" ~r~n'
        ls_syntax_gfx +='  category.displayeverynlabels="0"  category.droplines="0"  category.frame="1"  category.label="'+ls_LBCATEGORY+'"  category.majordivisions="0"  category.majorgridline="5"  category.majortic="4"  category.maximumvalue="0"  category.minimumvalue="0"  category.minordivisions="0"  category.minorgridline="0"  category.minortic="1"  category.originline="1"  category.primaryline="1"  category.roundto="0"  category.roundtounit="0"  category.scaletype="1"  category.scalevalue="2"  category.secondaryline="0"  category.shadebackedge="1"  category.dispattr.backcolor="536870912"  category.dispattr.alignment="2"  category.dispattr.autosize="0"  category.dispattr.font.charset="0"  category.dispattr.font.escapement="0"  category.dispattr.font.face="Arial"  category.dispattr.font.family="2"  category.dispattr.font.height="0"  category.dispattr.font.italic="0"  category.dispattr.font.orientation="0"  category.dispattr.font.pitch="1"  category.dispattr.font.strikethrough="0"  category.dispattr.font.underline="0"  category.dispattr.font.weight="400"  category.dispattr.format="[General]"  category.dispattr.textcolor="0"  category.dispattr.displayexpression="category"  category.labeldispattr.backcolor="536870912"  category.labeldispattr.alignment="2"  category.labeldispattr.autosize="0"  category.labeldispattr.font.charset="0"  category.labeldispattr.font.escapement="0"  category.labeldispattr.font.face="Arial"  category.labeldispattr.font.family="2"  category.labeldispattr.font.height="0"  category.labeldispattr.font.italic="0"  category.labeldispattr.font.orientation="0"  category.labeldispattr.font.pitch="1"  category.labeldispattr.font.strikethrough="0"  category.labeldispattr.font.underline="0"  category.labeldispattr.font.weight="400"  category.labeldispattr.format="[General]"  category.labeldispattr.textcolor="0"  category.labeldispattr.displayexpression="categoryaxislabel"  category.sort="1" ~r~n'
        ls_syntax_gfx +='  values.autoscale="1" ~r~n'
        ls_syntax_gfx +='  values.displayeverynlabels="0"  values.droplines="0"  values.frame="1"  values.label="'+ls_LBVALEUR+'"  values.majordivisions="0"  values.majorgridline="0"  values.majortic="3"  values.maximumvalue="1500"  values.minimumvalue="0"  values.minordivisions="0"  values.minorgridline="0"  values.minortic="1"  values.originline="1"  values.primaryline="1"  values.roundto="0"  values.roundtounit="0"  values.scaletype="1"  values.scalevalue="1"  values.secondaryline="0"  values.shadebackedge="0"  values.dispattr.backcolor="536870912"  values.dispattr.alignment="1"  values.dispattr.autosize="0"  values.dispattr.font.charset="0"  values.dispattr.font.escapement="0"  values.dispattr.font.face="Arial"  values.dispattr.font.family="2"  values.dispattr.font.height="0"  values.dispattr.font.italic="0"  values.dispattr.font.orientation="0"  values.dispattr.font.pitch="1"  values.dispattr.font.strikethrough="0"  values.dispattr.font.underline="0"  values.dispattr.font.weight="400"  values.dispattr.format="[General]"  values.dispattr.textcolor="0"  values.dispattr.displayexpression="value"  values.labeldispattr.backcolor="536870912"  values.labeldispattr.alignment="2"  values.labeldispattr.autosize="0"  values.labeldispattr.font.charset="0"  values.labeldispattr.font.escapement="900"  values.labeldispattr.font.face="Arial"  values.labeldispattr.font.family="2"  values.labeldispattr.font.height="0"  values.labeldispattr.font.italic="0"  values.labeldispattr.font.orientation="900"  values.labeldispattr.font.pitch="1"  values.labeldispattr.font.strikethrough="0"  values.labeldispattr.font.underline="0"  values.labeldispattr.font.weight="400"  values.labeldispattr.format="[General]"  values.labeldispattr.textcolor="0"  values.labeldispattr.displayexpression="valuesaxislabel" )~r~n'
    
    end choose

Face à l'agression, la puissance de l'intelligence

Hors ligne

 

#7 10-10-2007 09:52:39

sebdec  
Membre Geek
Lieu: Boulogne Billancourt
Date d'inscription: 23-04-2007
Messages: 21
Pépites: 84
Banque: 0

Re: Les graphes sous PB

Pfiou!
Hé bien!
Merci beaucoup, je vais prendre le temps d'étudier ce code et de l'adapter à mon besoin, je sonnerai si j'ai des questions!!!

Hors ligne

 

#8 10-10-2007 09:57:37

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: Les graphes sous PB

Avec plaisir ...


Face à l'agression, la puissance de l'intelligence

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22