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 


Set Advanced Checkbox States

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Jul 26, 2003 8:24 pm    Post subject: Set Advanced Checkbox States Reply with quote

This code can be used to set the check state of a checkbox. The unique
part about this code is that it can set the "INDETERMINATE" check state.

Enjoy. Very Happy

Code:
#################################
# Advanced Check States         #
# Copyright 2003 FreezingFire #
# Use at your own risk          #
# Free to use in your own code  #
#################################

  TITLE By FreezingFire
  DIALOG CREATE,Advanced Check States,-1,0,240,129,CLASS FFCSDlgTest,NOMIN
  %%hwnd = @strdel(@winexists(#FFCSDlgTest),1,1)
  DIALOG ADD,CHECK,CHECK1,11,9,222,18,Click the buttons below to change state
  DIALOG ADD,BUTTON,CHECKED,40,14,123,24,CHECKED
  %%hctrl = @strdel(@winexists(~CHECK1),1,1)
  DIALOG ADD,BUTTON,INDETERMINATE,67,14,123,24,INDETERMINATE
  DIALOG ADD,BUTTON,UNCHECKED,93,14,123,24,UNCHECKED
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:CHECKEDBUTTON
  LOADLIB user32.dll
  %A = @lib(user32,CheckDlgButton,BOOL:,INT:%%hwnd,INT:%%hctrl,INT:1)
  FREELIB user32.dll
  goto evloop
:INDETERMINATEBUTTON
  LOADLIB user32.dll
  %A = @lib(user32,CheckDlgButton,BOOL:,INT:%%hwnd,INT:%%hctrl,INT:2)
  FREELIB user32.dll
  goto evloop
:UNCHECKEDBUTTON
  LOADLIB user32.dll
  %A = @lib(user32,CheckDlgButton,BOOL:,INT:%%hwnd,INT:%%hctrl,INT:0)
  FREELIB user32.dll
  goto evloop
:CLOSE
  EXIT

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 619
Location: Indiana

PostPosted: Mon Oct 18, 2004 7:10 pm    Post subject: Reply with quote

Awesome Cool
Back to top
View user's profile Send private message Visit poster's website AIM Address
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Oct 19, 2004 12:36 am    Post subject: Reply with quote

Guess I skipped this post before, but you can use plain old @SendMsg to do the same thing. Not trying to overshadow FF's method, but just presenting a VDS only alternative.
This will also work in VDS 4 and maybe 3?
Code:

  DIALOG CREATE,Advanced Check States,-1,0,240,129
  DIALOG ADD,CHECK,CHECK1,11,9,222,18,Click the buttons below to change state
  DIALOG ADD,BUTTON,CHECKED,40,14,123,24,CHECKED
  DIALOG ADD,BUTTON,INDETERMINATE,67,14,123,24,INDETERMINATE
  DIALOG ADD,BUTTON,UNCHECKED,93,14,123,24,UNCHECKED
  DIALOG SHOW
  %%BM_SETCHECK = $0F1
  %%BST_CHECKED = $01
  %%BST_INDETERMINATE = $02
  %%BST_UNCHECKED = $00
:Evloop
  wait event
  goto @event()
:CHECKEDBUTTON
  %A = @SENDMSG(~Check1,%%BM_SETCHECK,%%BST_CHECKED,0)
  goto evloop
:INDETERMINATEBUTTON
  %A = @SENDMSG(~Check1,%%BM_SETCHECK,%%BST_INDETERMINATE,0)
  goto evloop
:UNCHECKEDBUTTON
  %A = @SENDMSG(~Check1,%%BM_SETCHECK,%%BST_UNCHECKED,0)
  goto evloop
:CLOSE
  EXIT

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code 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