Windows transitions

Everything else that doesn't fall into one of the other PB categories.
marvin
User
User
Posts: 35
Joined: Sun Jul 18, 2004 1:43 am

Windows transitions

Post by marvin »

Any one know how to use or code windows transitions for like a slide show.

Thanks
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Do a search for AnimateWindow and you'll find a few examples. Here's a quick snippet to get you started. :)

Code: Select all

If OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND) 
  AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE) 
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE) 
  AnimateWindow_(WindowID(0), 1000, #AW_BLEND) 
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND) 
  AnimateWindow_(WindowID(0), 1000, #AW_CENTER) 
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER) 
  AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE) 
  quit = 1
  Repeat
    event = WaitWindowEvent()
    If event = #PB_Event_CloseWindow
      quit = 1
    EndIf
  Until quit
EndIf
*** Edit to update code to PB4.x
Last edited by Sparkie on Sat Apr 12, 2008 3:59 pm, edited 2 times in total.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Post by UserOfPure »

None of Sparkie's code works with v4.20 Beta 4. When I run it, I never see a window at all. Using XP and yes I changed the "Test" parameter to the correct place. ;) It all works fine with v3.94 though.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Change this:

Code: Select all

OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
The example is for PB3.xx not for PB4.xx
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Post by UserOfPure »

I did. Read my post again. And besides, the bug is the very fact the window transitions work only with v3.94 and not v4.20 -- that's the point.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Works fine in PB4.3 - if you replace Sparkies window line wit TS-Softs!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Post by UserOfPure »

I did. Read my post again.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

I ran it fine in 4.2b2 as well.

Code: Select all

#AW_ACTIVATE = $20000 
#AW_BLEND = $80000 
#AW_CENTER = $10 
#AW_HIDE = $10000 
#AW_HOR_NEGATIVE = 2 
#AW_HOR_POSITIVE = 1 
#AW_SLIDE = $40000 
#AW_VER_NEGATIVE = 8 
#AW_VER_POSITIVE = 4 
OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

Repeat

AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND) 
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE) 
SendMessage_(WindowID(0), #WM_PAINT, 0, 0) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_BLEND) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_CENTER) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER) 
Delay(1000) 
AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE) 
Delay(1000) 

Until Event = #PB_Event_CloseWindow

End
The close window event will only owrk if the window is open... I reccomend killing it in the compiler. 8)
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

@UserOfPure
It works on PB4.20 beta 4

Minimize the PB-Ide after start to see the result!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

He has already started two bug reports on this.
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Post by UserOfPure »

ts-soft wrote:Minimize the PB-Ide after start to see the result!
Tried that, and still nothing. All I get is a button in the Taskbar. I'm using v4.20 Beta 4 too. I'm not stupid.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Test this please:

Code: Select all

Procedure CreateShellObject()
  Protected obj.l, hResult.l

  CoInitialize_(#Null)
  hResult = CoCreateInstance_(?CLSID_Shell_Application, 0, 1, ?IID_IShellDispatch, @obj)

  If Not hResult
    ProcedureReturn obj
  Else
    ProcedureReturn #False
  EndIf

  DataSection
    CLSID_Shell_Application:  ; {13709620-C279-11CE-A49E-444553540000}
    Data.l $13709620
    Data.w $C279,$11CE
    Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
    IID_IShellDispatch:  ; {D8F015C0-C278-11CE-A49E-444553540000}
    Data.l $D8F015C0
    Data.w $C278,$11CE
    Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
  EndDataSection
EndProcedure

Procedure ReleaseShellObject(obj.l)
  Protected object.IUnknown = obj
  object\Release()
EndProcedure

Define.IShellDispatch shell

shell = CreateShellObject()
If shell
  shell\MinimizeAll()       ; alle Fenster minimieren

  #AW_ACTIVATE = $20000
  #AW_BLEND = $80000
  #AW_CENTER = $10
  #AW_HIDE = $10000
  #AW_HOR_NEGATIVE = 2
  #AW_HOR_POSITIVE = 1
  #AW_SLIDE = $40000
  #AW_VER_NEGATIVE = 8
  #AW_VER_POSITIVE = 4
  OpenWindow(0, 10, 10, 300, 200, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
  AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_HOR_POSITIVE)
  SendMessage_(WindowID(0), #WM_PAINT, 0, 0)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_SLIDE | #AW_HOR_POSITIVE)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_BLEND)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_BLEND)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_CENTER)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_HIDE | #AW_CENTER)
  Delay(1000)
  AnimateWindow_(WindowID(0), 1000, #AW_SLIDE | #AW_VER_POSITIVE)
  Delay(1000)

  shell\UndoMinimizeALL()   ; minimieren rückgängig machen

  ReleaseShellObject(shell)
EndIf
Last edited by ts-soft on Sat Apr 12, 2008 6:54 am, edited 1 time in total.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Post by UserOfPure »

Yes, that works perfectly now (except for the #AW_BLEND animation, which still fails). I get a window in the center of the screen doing all the animations. But it's still a bug if v3.94 did it but v4.20 doesn't (on all PCs, that is). And who wants to minimize all windows to do it, when v3.94 didn't have to?
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

UserOfPure wrote:Yes, that works perfectly now (except for the #AW_BLEND animation, which still fails). I get a window in the center of the screen doing all the animations. But it's still a bug if v3.94 did it but v4.20 doesn't (on all PCs, that is). And who wants to minimize all windows to do it, when v3.94 didn't have to?
What would the bug be? All the code posted use mainly API functions.

I ran the example ts-soft posted and it worked with v4.1 and I didn't have to manually minimize any windows (using jaPBe).

Since you're a user of PureBasic, write the code so it does things the way you want it to be done. It's not a bug because an example written for someone else doesn't satisfy your needs.:wink:
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I've edited my orignal code to be PB4.x compliant.
Last edited by Sparkie on Sat Apr 12, 2008 4:52 pm, edited 1 time in total.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply