Author Topic: Mousewheel with ptc_ext?  (Read 7034 times)

0 Members and 1 Guest are viewing this topic.

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Mousewheel with ptc_ext?
« on: March 07, 2008 »
Huhu :)

I don't know if Rbraz is reading this but...
I have been working on a project for some friends who wanted an interface for thier charts.

http://www.intro-inferno.com/production.php?id=6066

Essentially the chart was just a simple interface and they have released three issues with this interface but I was not happy with it and I decided to add a lot more features to it.

One of the things I need to add is mouse wheel scrolling and I tried to do some reading on it and found that there is something called WM_MOUSEWHEEL

I have no idea how to use this though, can anyone give me any clue how I can use it to tell if the wheel has been scrolled up or down please?


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #1 on: March 07, 2008 »
No problem WidowMaker, I'll add it for you, it's really simple addition to the lib and it won't bloat your exe file.

I already have used mousewheel, check out trbs musicdisk, you can use it to control music volume, dunno if someone noticed it :)
Challenge Trophies Won:

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #2 on: March 07, 2008 »
Ravebusters remixes has a really gorgeous user interface :)

If you could add that mousewheel function, you will be saving me a lot of headaches, thank you so much!


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mousewheel with ptc_ext?
« Reply #3 on: March 08, 2008 »
WM_MOUSEWHEEL does actually do something.. As long as you have included the windows api "windows.bi"

test=WM_MOUSEWHEEL puts 512 into test

Reading the doccumentation about mouse functions

WM_MOUSEWHEEL

    WPARAM wParam
    LPARAM lParam;

The high order of wparam contains the amount that the wheel was rotated but the results seem to be sent to the focus window and then propogated down to the parent window.

I think you'll need to use something like defwindowproc / windowproc if you are in a hurry :)

It should be possible to do this without having to modify ptc_ext at all, however I must admit that I would love to have mouse wheel built into ptc_ext too.

K+ to rbraz for being very supportive as usual of his excellent library!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #4 on: March 08, 2008 »
I just don't seem to be able to figure it out Shock.


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #5 on: March 08, 2008 »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mousewheel with ptc_ext?
« Reply #6 on: March 08, 2008 »
You rock.  :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #7 on: March 08, 2008 »
Hi Rbraz, thank you very much for adding this much needed function to your great library, but something else seems to have changed too.

The screen does not open fast enough now when tinyptc_ext first opens the windows, it looks like the application has crashed in fact.

This is worse in windowed mode, where an empty window just hangs there for a few seconds before the program starts, in full screen mode, there is a similar delay and then a white line on the very bottom of the screen before the application start.

The last version of PTC_EXT never had the slow start-up, the window always opened immediately with no delay, so I am thinking maybe something else changed?

Maybe I am unusual but I think that the new opening of an application look like the program has crashed.. I was just about to bring up the task manager when my project then started up.

My chart engine is so close to being finished now :) Just these few small parts to do.

The mouse wheel command works well too Rbraz, easy to use as ever.  :clap: Bravo!

Please is there anything I can do to prevent the delay happening when I open a screen?


Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #8 on: March 08, 2008 »
I had noticed that delay too, but it didn't occur every time, anyway it's due to the new code to disable screen saver compatible with Vista that Jim suggested to change, in particular this line:
Code: [Select]
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETSCREENSAVEACTIVE, (LPARAM)"Desktop", SMTO_ABORTIFHUNG, 5000, &dwReturnValue);Which broadcast the change for screen saver setting to the system.

I did some changes in the code to minimize the empty window when program starts.

Unless the new changes is Ok for you, we will need help from Jim  :skint:
« Last Edit: March 08, 2008 by rbraz »
Challenge Trophies Won:

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #9 on: March 09, 2008 »
To be honest Rbraz, I don't care less for people's screen savers with Vista so would it matter if I took this line out from the lib?

I agree that it needs to have some compatibility but this is going too far, it fuck the screen initialisation up and make it look like my program has crashed.

PPL who have screen savers will probably not be looking at my stuff for more than a few minuites anyway so it is not important to me.

As always you have impressed with your fantastic library.
Seriously, most of the cracktro things released into the scene these days are using your lib.

The new charts really rock already, I hate these delays when starting up the screen... Is spoils the while experience.
Your lib is perfect for these old school style things, I hope we can get rid of the vista shit.

Seriously, fuck it. Who cares about screensavers when we are writing demo stuff :D

I wish I would meet you one day so I can show you how much I appreciate your lib.
You would not pay for a beer all month.

But for the sake of a screen saver interrupting my app?
I applaud the effort to keep it compliant but when it compromise something important like an initialisation then it need to be offered as an option to the coder at the very least.

Let the intros continue :) Thank you Rbraz!

You helped make this all possible.


Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #10 on: March 09, 2008 »
In fact after I just run my project again I waited 7 seconds for the window to be set up.

This fucking screensaver shit ruins the library mate.
Fuck screen savers.

I'd really like a link to the old lib please and I'll figure out the mouse stuff on my own thanks mate.

I have overwrote the last version of ptc_ext that I had and now all my apps are starting slow :( I have to get rid of this update now.

Sorry.

If you can give me any clues about getting the mousewheel and keeping the old ptc lib I will surely post any source I make tio help everyone.

Thank you very much. I am already sorry about this posts because I get a good feeling of how you love and care for this lib Rbraz. I love to use this lib and I hope that it will become distilled again without unnecessary stuff :)


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mousewheel with ptc_ext?
« Reply #11 on: March 09, 2008 »
Is it so bad to wait an extra 4 seconds to set up the window?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #12 on: March 09, 2008 »
Is it so bad to wait an extra 4 seconds to set up the window?
lol shock  ;D

Well, seems you are having troubles with your PC, as I said, the slowdown doesn't happen all the time.

Anyway, I have removed that code and bring back the old gaffer tpc code to disable screensaver, tried it several times and there's no problems here.

For now, I'll only attach it to this post for you.

Let me know if you still having problems...

And thanks for your kind words, it is really much appreciated :),  I know how much Shockwave loves this library and it's my pleasure to add stuff to it and watch his great software rendered programs.

« Last Edit: March 09, 2008 by rbraz »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mousewheel with ptc_ext?
« Reply #13 on: March 09, 2008 »
That's the one man.

That works perfect.  :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #14 on: March 09, 2008 »
Cool, I hope it works fine for WidowMaker too  ;)

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #15 on: March 09, 2008 »
Bad news about the screensaver thing.  The problem is the original stuff doesn't work on Vista, and it looks like some app on some people's laptops is responding badly to the new broadcast message technique (ie. hanging sometimes and having to time out).  I'll have to do some more research, as that is the recommended way to disable screensavers.

<edit>
Could change
Code: [Select]
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETSCREENSAVEACTIVE, (LPARAM)"Desktop", SMTO_ABORTIFHUNG, 5000, &dwReturnValue);to
Code: [Select]
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETSCREENSAVEACTIVE, (LPARAM)"Desktop", SMTO_ABORTIFHUNG, 50, &dwReturnValue);
That would say 'hang for 1/50th of a second if something screws up' instead of 'hang for 5 seconds if something screws up'.

Jim
« Last Edit: March 09, 2008 by Jim »
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Mousewheel with ptc_ext?
« Reply #16 on: March 09, 2008 »
I already tried to use a low value for "time-out duration", but it still waiting for 3 or 4 seconds to startup, but it doesn't happen all the time.
Challenge Trophies Won:

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Mousewheel with ptc_ext?
« Reply #17 on: March 09, 2008 »
It works perfect here now.

Thanks :)