Page 1 sur 1

Popup

Publié : ven. 19/oct./2007 15:54
par Dr. Dri
Je sais pas si on trouve des tutos là dessus mais vla un code assez simple pour ceux qui se demandent comment faire.

Code : Tout sélectionner

If OpenWindow(0, 0, 0, 270, 160, "Popup", #PB_Window_SystemMenu | #PB_Window_Invisible)
  CreateGadgetList(WindowID(0))
  
  TextGadget(0, 10,  10, 250, 20, "TextGadget Standard (Left)")
  TextGadget(1, 10,  70, 250, 20, "TextGadget Center", #PB_Text_Center)
  TextGadget(2, 10,  40, 250, 20, "TextGadget Right", #PB_Text_Right)
  TextGadget(3, 10, 100, 250, 20, "TextGadget Border", #PB_Text_Border)
  TextGadget(4, 10, 130, 250, 20, "TextGadget Center + Border", #PB_Text_Center|#PB_Text_Border)
  
  SystemParametersInfo_(#SPI_GETWORKAREA, #Null, area.Rect, 0)
  GetWindowRect_(WindowID(0), rc.Rect)
  
  x = area\right  - (rc\right - rc\left)
  y = area\bottom - (rc\bottom - rc\top)
  ResizeWindow(0, x, y, #PB_Ignore, #PB_Ignore)
  
  PlaySound_("SystemQuestion", #Null, #SND_ALIAS|#SND_ASYNC|#SND_NOWAIT)
  AnimateWindow_(WindowID(0), 200, #AW_SLIDE|#AW_VER_NEGATIVE)
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Dri

Publié : ven. 19/oct./2007 16:39
par Ar-S
Merci Dri, l'effet est très propre !

Peux tu commenter

Code : Tout sélectionner

  SystemParametersInfo_(#SPI_GETWORKAREA, #Null, area.Rect, 0)
  GetWindowRect_(WindowID(0), rc.Rect) 
et

Code : Tout sélectionner

  PlaySound_("SystemQuestion", #Null, #SND_ALIAS|#SND_ASYNC|#SND_NOWAIT)
  AnimateWindow_(WindowID(0), 200, #AW_SLIDE|#AW_VER_NEGATIVE) 
Parceque même si je comprends ce qu'ils engendrent (et encore), je ne vois pas d'ou ça sort ces commandes.

Ce sont des API :?:

Publié : ven. 19/oct./2007 16:41
par venom
salut Dr. Dri

oui cette effect est bien simpa d'autant plus que certin sur ce forum voudrai faire un client msn :D sa pourrais leur etre utile :wink: .


@++

Publié : ven. 19/oct./2007 16:43
par Dr. Dri
http://msdn2.microsoft.com/en-us/library/ms712879.aspx
http://msdn2.microsoft.com/en-us/library/ms632669.aspx

sinon je recommande de récupérer win32.hlp et de le mettre dans un répertoire help dans le dossier d'installation de purebasic. comme ça l'aide avec F1 marche sur ce type de fonction.

Dri

Publié : sam. 20/oct./2007 15:21
par Dr. Dri
une variante ^^

Code : Tout sélectionner

If OpenWindow(0, 0, 0, 270, 160, "Popup", #PB_Window_SystemMenu | #PB_Window_Invisible)
  CreateGadgetList(WindowID(0))
 
  TextGadget(0, 10,  10, 250, 20, "TextGadget Standard (Left)")
  TextGadget(1, 10,  70, 250, 20, "TextGadget Center", #PB_Text_Center)
  TextGadget(2, 10,  40, 250, 20, "TextGadget Right", #PB_Text_Right)
  TextGadget(3, 10, 100, 250, 20, "TextGadget Border", #PB_Text_Border)
  TextGadget(4, 10, 130, 250, 20, "TextGadget Center + Border", #PB_Text_Center|#PB_Text_Border)
 
  SystemParametersInfo_(#SPI_GETWORKAREA, #Null, area.Rect, 0)
  GetWindowRect_(WindowID(0), rc.Rect)
 
  x = area\right  - (rc\right - rc\left)
  y = area\bottom - (rc\bottom - rc\top)
  ResizeWindow(0, x, y, #PB_Ignore, #PB_Ignore)
 
  PlaySound_("SystemQuestion", #Null, #SND_ALIAS|#SND_ASYNC|#SND_NOWAIT)
  AnimateWindow_(WindowID(0), 200, #AW_SLIDE|#AW_HOR_NEGATIVE)
 
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Dri