Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Scroll bars in pocketc

Scroll bars in pocketc

Discuss PocketC for CE (including Desktop Edition)

Postby Red_as_blood on Mon Feb 24, 2003 11:23 am

With the createctrl() function can i create scroll bars?

if it is possible how do i control them (with sendmsg function?)

or i must use CE API? because i do not know how to use these librarys
Red_as_blood
 
Posts: 13
Joined: Sat Aug 10, 2002 2:06 pm

Postby guy on Mon Feb 24, 2003 1:38 pm

If you want individual scroll bar controls then you need to use CEAPI to set them up. If you just want scroll bars on another control like an EDIT control or a list or combo box then you can simply set a flag in the style for the control when you create it.

The following code is the scroll bar example program included with CEAPI (sbtest.pc):

Code: Select all

#include "/pocketc/winuser.h"

#define IDC_SCROLLBAR 100           // guiid to use for scroll bar

main() {

    HWND        hScrollBar ;        // Window handle for scroll bar
    SCROLLINFO  rScroll ;           // Scroll bar set/read info

    createctrl("SCROLLBAR", "", WS_VISIBLE | WS_CHILD | SBS_HORZ, 0, 100, 100, 200, 25, IDC_SCROLLBAR) ;

    hScrollBar = gethwnd(IDC_SCROLLBAR) ;

    rScroll.cbSize      = 0 ;       // Set by CEAPI interface
    rScroll.fMask       = SIF_ALL ; // Set all parameters
    rScroll.nMin        = 0 ;       // Scroll range is from 0
    rScroll.nMax        = 100 ;     // To 100
    rScroll.nPage       = 0 ;
    rScroll.nPos        = 0 ;
    rScroll.nTrackPos   = 0 ;

//  Setup the scroll bar

    SetScrollInfo(hScrollBar, SB_CTL, &rScroll, 1) ;

//  Sit in a loop reading the current scroll position and where the user has moved it to

    while (TRUE) {

//      Get the current position and user's desired position

        rScroll.fMask = SIF_TRACKPOS | SIF_POS ;
        GetScrollInfo(hScrollBar, SB_CTL, &rScroll) ;

//      Display them both on the screen

        text(100, 150, "" + rScroll.nPos + "    ") ;
        text(100, 175, "" + rScroll.nTrackPos + "    ") ;

//      Update the actual position with where the user wants it to be

        sleep(1) ;
        SetScrollPos(hScrollBar, SB_CTL, rScroll.nTrackPos, 1) ;
    }
}




The scroll bar doesn't update itself, unlike the track bar. If you drag the slider on a scroll bar and let go then it will bounce back to where it was before unless the program repositions it.

Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron