Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Pages: 1
Une petite fonctionnalité pour automatiser les colonnes accessibles ou non,
suivant les droits d'acces de l'utilisateur...
Attention, eviter d'attribuer la couleur invisible à vos colonnes...
Importer la fonction f_protectdwcolumn
$PBExportHeader$f_protectdwcolumn.srf $PBExportComments$[LF] modification des attributs de colonnes global type f_protectdwcolumn from function_object end type forward prototypes global subroutine f_protectdwcolumn (boolean ab_disable, datawindow adw_dw, string as_column[]) end prototypes global subroutine f_protectdwcolumn (boolean ab_disable, datawindow adw_dw, string as_column[]);//------------------------------------------------------------------------------------- // FUNCTION: f_protectdwcolumn // // DESCRIPTION: change une (ou plusieurs) colonne d'une dw // du mode saisissable au mode non saisissable // // ARGUMENTS: ab_disable - indicateur vrai/faux // adw_dw - nom de la dw // as_column[] - liste des colonnes // // RETURNS: // // AUTHOR: //------------------------------------------------------------------------------------- string ls_color, ls_protect integer li_col IF ab_disable THEN ls_color = string(rgb(230,230,230)) ls_protect = '1' ELSE ls_color = string(rgb(255,255,255)) ls_protect = '0' END IF IF IsValid(adw_dw) THEN adw_dw.SetRedraw(FALSE) FOR li_col = 1 TO UpperBound(as_column) IF adw_dw.Describe(as_column[li_col] + ".name") = as_column[li_col] THEN adw_dw.Modify(as_column[li_col] + ".background.color='" + ls_color + "'") adw_dw.Modify(as_column[li_col] + ".protect='" + ls_protect + "'") END IF NEXT adw_dw.SetRedraw(TRUE) END IF end subroutine
puis tester sur une de vos datawindows :
string ls_colonne[] ls_colonne[1] = 'dt_datemaj' ls_colonne[2] = 'nom_user' f_protectdwcolumn(true, dw_detail , ls_colonne)
Hors ligne
Merci bien pick ouic je vais m'en servir !
Hors ligne
Pages: 1