forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to Resize Status panels dynamically?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sat Mar 05, 2005 3:02 am    Post subject: How to Resize Status panels dynamically? Reply with quote

Does anyone know how to resize Status panels dynamically?

I have a resizable dialog with a three panel status and need to change the length of the first panel as the dialog size changes.

I've tried with DIALOG SET and DIALOG SETPOS

Can this be done or is it fixed when the dialog is created?


Thanks in advance Smile
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 05, 2005 3:17 am    Post subject: Reply with quote

I'm not sure how you're creating the status panel, either using VDS or an
external dll, so let me give a couple answers.

If you are using SSMenu.Dll, but I should not that you can use SSMenu.Dll
to do this even if VDS created the status bar.

Example:
%%WindowWidth = ?
Panel1 = ?
Panel2 = 80
Panel3 = 100
Code:

:Resize
  %%WindowWidth = @winpos(SomeWindow,W)
  menu status_setParts,StatusName,@diff(%%WindowWidth,180)|@diff(%%WindowWidth,100)|%%WindowWidth


If you use SSMenu.Dll to do this on a statusbar that it didn't create, the
above 'StatusName' parameter must be that statusbars window identifier,
obtained with the @winexists() function.

This isn't possible using API because the (LPARAM) of the message
requires an array of integers that specify the right edges of each panel.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sat Mar 05, 2005 3:40 am    Post subject: Reply with quote

Thanks Bweckel,

Hehe Go VOLS!!! Wave

So I guess this can't be done without and external dll?
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 05, 2005 3:59 am    Post subject: Reply with quote

Aslan wrote:
Thanks Bweckel,

Hehe Go VOLS!!! Wave

So I guess this can't be done without and external dll?


You're welcome and GO VOLS !!!!!

To the best of my knowledge this can't be done by VDS alone.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 05, 2005 5:36 pm    Post subject: Reply with quote

After some research, I've found that this can be accomplished with VDS 5.

Here's what I came up with:
Code:

%%SB_ISSIMPLE = 1038
  %%SB_SIMPLE = 1033
  %%SB_SETPARTS = 1028
  %%SB_SETTEXTA = 1025
 
  dialog create,Test,-1,0,300,200,RESIZABLE
  dialog add,STATUS,Stat
  dialog show
 
  %%stat = @winexists(~Stat)
  rem VDS creates the statusbar in Simple mode, so we need to   
  rem change it so that we can set multiple panels.             
  %%bSimple = @sendmsg(%%stat,%%SB_ISSIMPLE,0,0)
  if @equal(%%bSimple,1)
    rem Yep, we're in simple mode, so let's get out of it.     
    %z = @sendmsg(%%stat,%%SB_SIMPLE,0,0)
  end
 
:Evloop
  wait event
  goto @event()
 
:RESIZE
  %%width = @winpos(Test,W)
  %%parts = @binary(DWORD,@diff(%%width,150))@binary(DWORD,@diff(%%width,100))@binary(DWORD,%%width)
  %z = @sendmsg(%%stat,%%SB_SETPARTS,3,%%parts)
  rem Changing the statusbars parts redraws the control, so we 
  rem also need to reset the text for each panel. The default   
  rem border for the statusbar is sunken. In order to use any of
  rem the other styles, the WPARAM of the message must be the   
  rem panel number ORed together with the style. Since we can't
  rem easily OR values together, we'll settle for the defaults.
  %z = @sendmsg(%%stat,%%SB_SETTEXTA,0,Part1)
  %z = @sendmsg(%%stat,%%SB_SETTEXTA,1,Part2)
  %z = @sendmsg(%%stat,%%SB_SETTEXTA,2,Part3)
  goto Evloop
 
:CLOSE
  exit
 


No externals needed Smile.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sat Mar 05, 2005 7:37 pm    Post subject: Reply with quote

This worked perfectly. Many Thanks Very Happy Wink
Back to top
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 05, 2005 9:53 pm    Post subject: Reply with quote

Was glad to help. Smile Although doing this doesn't help promote my SSMenu.Dll
either Confused But hey, ya can't have it all. Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Tue Mar 08, 2005 2:59 am    Post subject: Reply with quote

Bill,

Is it possible to put a bitmap on the third panel rather than text?

Regards.

_________________
John Trappett
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 08, 2005 3:18 am    Post subject: Reply with quote

Hi John,

To use an image, or glyph if you like, the statusbar requires that it be an
icon. You can use the API call LoadImage(), to load an icon and to get a
handle to that icon that you can use to set the icon for a status panel.

Since I don't use VDS 5, I really shouldn't be posting examples for it. Sad

But basically after calling LoadImage(), use @sendmsg() to send the
statusbar a SB_SETICON message with the WPARAM set to the panel# you
want the icon to be shown in, and the LPARAM set with the returned icon
handle you got from LoadImage(). If you are going to use images that are
larger than 15x15 pixels, you should also send the statusbar a
SB_SETMINHEIGHT message with the WPARAM set to the height in pixels
and the LPARAM set to 0. You must also then send the statusbar a
WM_PAINT message or use the InvalidateRect() and UpdateWindow()
API calls to force the statusbar to repaint itself.

If this doesn't explain it, PM me or email me and I'll see if I can't come up
with an example for you.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 08, 2005 3:35 am    Post subject: Reply with quote

Now to promote myself:: Twisted Evil Twisted Evil

All of the above is easier to accomplish using SSMenu.Dll Cool

Which can be downloaded here -> SSMenu.Dll 2.01

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Tue Mar 08, 2005 5:46 am    Post subject: Reply with quote

Thanks Bill... it sounds like SSMenu is the easier way to go Wink

Regards.

_________________
John Trappett
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group