Après windows pour les nuls, voici PB pour les bons (ou presque).

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 30-05-2007 09:13:11

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

[RESOLU] MicroHelp

J'aimerai savoir s'il y avait une possibilité de scindé la MicroHelp
Par exemple mettre     l'heure d'un coté
l'aide du menu de l’autre,
le temps de connexion au milieu ….
Merci


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

Hors ligne

 

#2 30-05-2007 09:23:37

rincevent  
Modérateur
Award: bf
Lieu: Belgique
Date d'inscription: 06-02-2007
Messages: 722
Pépites: 100,002,023
Banque: 0

Re: [RESOLU] MicroHelp

y a moyen mais c'est un peu du bricolage, néanmoins le résultat est correct donc pourquoi pas ?

Voilà un exemple de comment faire :


Putting Time On The Right Side Of MDI Microhelp

POWERBUILDER FAXBACK DOCUMENT 2034

Code: pb

// this combination of scripts will allow you to display the time on
// the right side of mdi microhelp. it uses pop-up window that contains
// a single line edit. the sle displays the time. the pop-up window is
// placed on the mdi frame over the microhelp, and is moved whenever
// the frame moves or is resized.
//
// instance variables for the mdi frame
integer ox,oy,oh,ow  // old x,y and height, width

w_popup lpop          // local popup which traipes ...
// end instance variables for mdi frame

// Open event for w_MDI_frame
integer wx,wy,wh,ww                     // workspace extents
ox=this.x
oy=this.y
oh=this.height
ow=this.width

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

open(lpop)
move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)
show(lpop)

//Resize event for w_MDI_frame
integer wx,wy,wh,ww

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

if ( handle (lpop) > 0 ) then
    move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)
end if

SetFocus(this)

// User event for pbm_move for w_MDI_frame
integer wx,wy,wh,ww

wx=this.workspacex ( )
wy=this.workspacey ( )
wh=this.workspaceheight ( )
ww=this.workspacewidth ( )

if ( handle (lpop) > 0 ) then
    move(lpop,wx+ww - lpop.width - 15,wy+wh - lpop.height - 22)

end if

SetFocus(this)

// Open event for w_popup
sle_time.weight = 300
Timer(5)
triggerevent(this,timer!)

//Timer event for w_popup
Time t
t=now()
sle_time.hide ( )       //hide the sle

sle_time.text=space(len(sle_time.text))
sle_time.text=string(hour(t))+":"+&
string(Minute(t))+":"+string(Second(t))

sle_time.show ( )       //re-show the sle




http://img114.imageshack.us/img114/8519/userbar175801nb.gif
Pourquoi ne puis-je vivre comme n'importe quel être humain ? Pourquoi mon destin est-il de ne pouvoir cesser de me battre ?

Hors ligne

 

#3 30-05-2007 11:00:38

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: [RESOLU] MicroHelp

Merci Mais
Je viends de le faire c'est pas genial ... c'est vraiment du bricolage ....


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

Hors ligne

 

#4 30-05-2007 11:21:25

foon  
N2iGeek + MangasGeek = foon
Award: bf
Lieu: Bonchamp-Lès-Laval
Date d'inscription: 28-02-2007
Messages: 2491
Pépites: 100
Banque: 9,223,372,036,854,776,000

Re: [RESOLU] MicroHelp

Il reste la solution de créer une microhelp spécifique, mais c'est beaucoup de boulot et il faut obligatoirement la raccorder à l'objet ancêtre de ta mdihelp (C'est ce qui a été fait chez mon client: ils ont un framework spécifique avec ce genre de "joujou")


Seuls ceux qui ne font rien ne font jamais d'erreurs
http://www.nerdtests.com/images/badge/163124fb7fb459a3.gif

Hors ligne

 

#5 22-11-2007 13:17:40

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: [RESOLU] MicroHelp

J'ai trouvé cela
Et cela marche super bien


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

Hors ligne

 

#6 23-11-2007 10:25:49

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: [RESOLU] MicroHelp

voici le code en pb10
fenetre : w_statusbar

Code: pb

forward
global type w_statusbar from window
end type
type st_message_border from statictext within w_statusbar
end type
type st_date_border from statictext within w_statusbar
end type
type st_time_border from statictext within w_statusbar
end type
type ln_far_left from line within w_statusbar
end type
type st_time from statictext within w_statusbar
end type
type st_date from statictext within w_statusbar
end type
type st_message from statictext within w_statusbar
end type
end forward

global type w_statusbar from window
integer width = 905
integer height = 72
boolean border = false
windowtype windowtype = child!
long backcolor = 79741120
st_message_border st_message_border
st_date_border st_date_border
st_time_border st_time_border
ln_far_left ln_far_left
st_time st_time
st_date st_date
st_message st_message
end type
global w_statusbar w_statusbar

type prototypes
Function integer GetClassName ( &
  ulong hWind, &
  Ref string name, &
  int cbmax &
  ) Library "user32.dll" Alias For "GetClassNameW"

Function ulong GetWindow ( &
  ulong hWind, &
  uint fuRel &
  ) Library "user32.dll"

Function ulong SetParent ( &
  ulong hChild, &
  ulong hParent &
  ) Library "user32.dll"

end prototypes

type variables
window      iw_frame 

String is_classname
Integer ii_width
Long  il_temps_connection
end variables

forward prototypes
public subroutine wf_set_message (string as_msg)
public subroutine wf_reposition ()
public subroutine wf_setparent ()
end prototypes

public subroutine wf_set_message (string as_msg);//// set message
//st_message.text = " " + Trim(as_msg)
//
//// update date/time
//this.Event Timer()

end subroutine

public subroutine wf_reposition ();Integer li_share

// if the window would be more than 2/3
// of width hide it off to the right
li_share = (iw_frame.width / 3) * 2
If this.ii_width > li_share Then
  this.x = iw_frame.width
Else
  If iw_frame.WindowState = Maximized! Then
    this.x = iw_frame.width - ii_width - 25
  Else
    this.x = iw_frame.width - ii_width - 90
  End If
End If
this.y = 5

// update date/time
//this.Event Timer()

end subroutine

public subroutine wf_setparent ();String ls_name
ULong lul_hwnd
Integer li_rc

// find the microhelp handle
lul_hwnd = GetWindow(Handle(iw_frame), 5)
DO UNTIL lul_hwnd = 0
  ls_name = Space(25)
  li_rc = GetClassName(lul_hwnd, ls_name, Len(ls_name))
  If ls_name = is_classname Then
    lul_hwnd = SetParent(Handle(this), lul_hwnd)
    lul_hwnd = 0
  Else
    lul_hwnd = GetWindow(lul_hwnd, 2)
  End If
LOOP

end subroutine

on w_statusbar.create
this.st_message_border=create st_message_border
this.st_date_border=create st_date_border
this.st_time_border=create st_time_border
this.ln_far_left=create ln_far_left
this.st_time=create st_time
this.st_date=create st_date
this.st_message=create st_message
this.Control[]={this.st_message_border,&
this.st_date_border,&
this.st_time_border,&
this.ln_far_left,&
this.st_time,&
this.st_date,&
this.st_message}
end on

on w_statusbar.destroy
destroy(this.st_message_border)
destroy(this.st_date_border)
destroy(this.st_time_border)
destroy(this.ln_far_left)
destroy(this.st_time)
destroy(this.st_date)
destroy(this.st_message)
end on

event open;boolean   lb_find

iw_frame = This.ParentWindow()
Do While (Not IsNull(iw_frame)) And (Not lb_find)
  If Not iw_frame.WindowType = MdiHelp! Then 
    iw_frame = iw_frame.ParentWindow()
  Else
    lb_find = True
  End If
Loop
If Not lb_find Then 
  Close(This)
Else

  Environment le_env
  
  GetEnvironment(le_env)
  il_temps_connection = 0
  // determine position of window within microhelp bar
  ii_width = st_time.x + st_time.width + 25
  this.width = ii_width
  
//   set object class name
  If le_env.PBMajorRevision = 10 And &
    le_env.PBMinorRevision = 5 Then
    // PowerBuilder 10.5
    is_classname = "FNHELP105"
  Else
    is_classname = "FNHELP" + &
      String(le_env.PBMajorRevision * 10)
  End If
  
  // set parenthood
  this.wf_setparent()
  
  // position the window
  this.wf_reposition()
  
  // initiate timer
  Timer(1)
End if

end event

event timer;// set current time
st_time.text = String(Now(), "hh:mm:ss")

// set current date
st_date.text = String(Today(), "dd/mm/yyyy")
il_temps_connection = il_temps_connection +1
st_message.text = string(truncate(il_temps_connection/60,0),'00')  +' : ' + string(mod(il_temps_connection,60),'00')

end event

type st_message_border from statictext within w_statusbar
integer x = 14
integer y = 4
integer width = 297
integer height = 64
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
boolean enabled = false
boolean border = true
borderstyle borderstyle = stylelowered!
boolean focusrectangle = false
end type

type st_date_border from statictext within w_statusbar
integer x = 320
integer y = 4
integer width = 311
integer height = 64
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
boolean enabled = false
boolean border = true
borderstyle borderstyle = stylelowered!
boolean focusrectangle = false
end type

type st_time_border from statictext within w_statusbar
integer x = 635
integer y = 4
integer width = 256
integer height = 64
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long textcolor = 33554432
long backcolor = 67108864
boolean enabled = false
boolean border = true
borderstyle borderstyle = stylelowered!
boolean focusrectangle = false
end type

type ln_far_left from line within w_statusbar
long linecolor = 16777215
integer linethickness = 4
integer beginy = 4
integer endy = 68
end type

type st_time from statictext within w_statusbar
integer x = 640
integer y = 8
integer width = 242
integer height = 56
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 79741120
alignment alignment = center!
boolean focusrectangle = false
end type

type st_date from statictext within w_statusbar
integer x = 325
integer y = 8
integer width = 302
integer height = 56
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 79741120
alignment alignment = center!
boolean focusrectangle = false
end type

type st_message from statictext within w_statusbar
integer x = 18
integer y = 8
integer width = 283
integer height = 56
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "MS Sans Serif"
long backcolor = 79741120
alignment alignment = right!
boolean focusrectangle = false
end type

puis mettre dans la mdi
dans le close

Code: pb

// close status bar
If IsValid(w_statusbar) Then
  Close(w_statusbar)
End If


dans l'open

Code: pb

// open status bar
Open(w_statusbar)


dans le resize

Code: pb

// notify status bar of resize
If IsValid(w_statusbar) Then
  w_statusbar.wf_reposition()
End If

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

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22