Originally posted by Michael Mattias
View Post
Announcement
Collapse
No announcement yet.
up down control
Collapse
X
-
-
This is totally incorrect.
When the use clicks the up or down pointing arrow button, the control sends a UDN_DELTAPOS notification messag
MCM
Leave a comment:
-
Originally posted by Dale Yarker View Post??????????????????????????????????????????????????????
Why did you put that code here after necro posting it in Programming?
Posting in an inappropriate forum area
Duplicate posting
Not wrapping code in [code]....[/code] tags
Lots of coding problems:
using the "no longer supported" CbHndl
Not setting buddy initially which results in first UpDown click not being recognised
sending %UDM_SetBuddy on every WM_COMMAND message to the UpDown control
passing the out of range 33333333320 as the low 16 bits of MAK(LONG...)
Using MAK(LONG) with SETRANGE32 instead of just passing a long. (MAK(LONG) is only useful with SETRANGE)
Declaring la as as SINGLE to store long integer UPDOWN position values
Assigning a value to la but never using it
Declaring temp$ and not using it
Using "magic number" control IDs after assigning meaningful equates
(That'll do for now)
Leave a comment:
-
??????????????????????????????????????????????????????
Why did you put that code here after necro posting it in Programming?
Leave a comment:
-
CODE:
#Compile Exe
#Dim All
#Include "Win32API.inc"
#Include "commctrl.inc" '<--- include to work in PBWin9 DID NOT TRY IN PBWIN9 RUNS IN MY PBWIN10.3
%IDC_TextBox = 500
%IDC_UpDown = 501
Global Hdlg As Dword
Global sd , sa As String
Global la As Single
Function PBMain() As Long
Dialog New Pixels, 0, "Up-Down Control",300,400,240,175, %WS_OverlappedWindow To Hdlg
Control Add TextBox, Hdlg, %IDC_TextBox, sa, 50,20,150,40,,%WS_EX_TRANSPARENT
ShowWindow GetDlgItem( Hdlg, 500 ), %SW_HIDE '%SW_SHOW
' Control Add Label, Hdlg, 502,"0", 20,10,150,30
Control Add TextBox, Hdlg, 502, sd, 50,80,150,40
Control Add "msctls_updown32", Hdlg, %IDC_UpDown, "", 195, 20, 38, 38, %WS_Child Or %WS_Border _
Or %WS_Visible Or %UDS_ArrowKeys Or %UDS_SetBuddyInt 'Or %UDS_AlignRight
Control Send Hdlg, %IDC_UpDown, %UDM_Setpos32, 0, 15
'Sets starting pos32
Control Send Hdlg, %IDC_UpDown, %UDM_SetRange32, 0, Mak(Long,33333333320,0)
' Sets range 32
Dialog Show Modal Hdlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local temp$
If CB.Ctl = %IDC_UpDown Then
Control Send CbHndl, %IDC_UpDown, %UDM_SetBuddy, GetDlgItem(Hdlg, 500), 0
'Sends to 500 which is hidden
'Moves From 500 To Visible 502
Control Get Text CbHndl, 500 To sd
Control Set Text CbHndl, 502, sd
la = val(sd)
'Convert from a string to a number
Exit Function
End If
End Function
' Thanks gBeenE For The Start
Leave a comment:
-
I've just posted a minimalist demonstration of using an UpDown control in the Source Code forum (PBWin - DDT).
https://forum.powerbasic.com/forum/u...emo#post800033
No need to trap notification methods or work out which button was clicked, it all happens automagically when the UpDown control updates its buddy textbox.
Leave a comment:
-
Originally posted by James C Morgan View PostThe up-down Control makes an Object distinction between its Button components.
For example, when the User clicks the up pointing arrow Button,
the Control fires the UpClick() event. On the other hand,
when the User clicks the down pointing arrow Button,
the Control sends a DownClick() event. These allow you To treat each event separately If you want.
When the use clicks the up or down pointing arrow button, the control sends a UDN_DELTAPOS notification message. The associated NM_UPDOWN structure contains information you can use to determine which arrow was clicked (the iDelta member)
Leave a comment:
-
Is there a question in this thread, or is it just a random incorrect statement about a "non-PB" Window's control?
Leave a comment:
-
For example, when the User clicks the up pointing arrow Button,
the Control fires the UpClick() event. On the other hand,
when the User clicks the down pointing arrow Button,
the Control sends a DownClick() event. These allow you To treat each event separately If you want.
PB/CC does not offer 'DDT' in any event, but it does support all the Windows' API window management functions.
The updown control is a standard Microsoft Common Control and there are some examples here on the BBS. (I have one right here... I used an updown control even though the demo was for the use of the waitable timer object).
Waitable Timer Object Demo June 2005
That thread also has a PB/Win 10 version added later by a couple of users.
MCM
Leave a comment:
-
????
Why is this not in PowerBASIC For Windows section?
PBCC does not have controls.
This and the other day; do you not realize there are two separate compilers?
Cheers,
Leave a comment:
-
up down control
The up-down Control makes an Object distinction between its Button components.
For example, when the User clicks the up pointing arrow Button,
the Control fires the UpClick() event. On the other hand,
when the User clicks the down pointing arrow Button,
the Control sends a DownClick() event. These allow you To treat each event separately If you want.Tags: None
Leave a comment: