Announcement

Collapse
No announcement yet.

PB pontential purchaser questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    Here's the compile log fo the tour application (compiled 12/3/07).
    Code:
    PowerBASIC Compiler for Windows
    PB/Win  Version 7.02 
    Copyright (c) 1996-2003 PowerBasic Inc.
    Carmel, California, USA
    All Rights Reserved
    
    Primary source:  D:\SOFTWA~1\Products\ppps\demo\pppsdemov3.bas   {34400 total lines}
    Target compilation:  pppstour.exe
    Compile time:  0.7 seconds, at 2948571 lines/minute
    
    25600 bytes compiled code, 26350 bytes RTLibrary,
    1380 bytes string literals, and 3744 bytes dgroup.
    Executable stack size:  1048576 bytes.
    Disk image: 463360 bytes   Memory image: 31474 bytes.
    Note that of the 34,000 lines total, the actual "program" file (pppsdemov3.bas) is only 1674 lines... and that's with
    my comments included (and I comment A LOT). The rest is #INCLUDE files:
    Code:
    Files supplied with the compiler: 
    #INCLUDE "WIN32API.INC"    ' DATE: May 9 2002    ' 24,358 lines
    #INCLUDE "richedit.inc"                               982 lines
    ' #INCLUDE files from my library:
    #INCLUDE "STDOUT_PBWIN.INC"            about 100 lines
    #INCLUDE "tsResource.inc"                    681 lines
    ' file from Tony Burcham I downloaded from here. 
    #INCLUDE "ShowPic.inc"          418 lines
    No, I've never been able to foot the compiler's line and statement counts to physical file sizes.

    Plus some of the #INCLUDE files themself #INCLUDE other files, but Ultra-Edit has no way to easily find them for me.

    PB Codec does, however... let me run that against the main source and see what I get...
    Code:
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     PBcodec report: PPPSDEMOV3.BAS + include files. Generated 04-26-2008, 09:25:44
     4296 lines scanned in 0.077 seconds (3336699 lines/minute)
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     MAIN + INCLUDE FILES
    --------------------------------------------------------------------------------
     D:\Software_Development\Products\ppps\demo\pppsdemov3.bas [Main source file]
     D:\Software_Development\Products\ppps\demo\SHOWPIC.INC    [pppsdemov3.bas]
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     UN-USED FUNCTIONS  (exported, or in incl. files, may be used by other programs)
    --------------------------------------------------------------------------------
     FUNCTION ResourcesbyType                             [pppsdemov3.bas] : 974
     FUNCTION LoadFile                                    [pppsdemov3.bas] : 1155
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     UN-USED SUBS  (exported, or in incl. files, may be used by other programs)
    --------------------------------------------------------------------------------
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     DECLARED, BUT NON-EXISTING SUB/FUNCTION(S)
    --------------------------------------------------------------------------------
     FUNCTION PT_UnCompress                               [pppsdemov3.bas] : 167
     FUNCTION DllVer                                      [pppsdemov3.bas] : 204
     FUNCTION PT_UnCompress                               [pppsdemov3.bas] : 1106
     FUNCTION RelCall                                     [SHOWPIC.INC] : 79
     FUNCTION RendCall                                    [SHOWPIC.INC] : 81
     FUNCTION RendCall2                                   [SHOWPIC.INC] : 85
     FUNCTION RendCall3                                   [SHOWPIC.INC] : 94
     FUNCTION DimenCall                                   [SHOWPIC.INC] : 103
     FUNCTION GetCurDC                                    [SHOWPIC.INC] : 104
     FUNCTION GetIPic                                     [SHOWPIC.INC] : 105
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     EXISTING, BUT NON-DECLARED SUB/FUNCTION(S)
    --------------------------------------------------------------------------------
       1 FUNCTION IsScClose                              [pppsdemov3.bas] : 100
       3 FUNCTION SetToolTip                             [pppsdemov3.bas] : 206
       1 FUNCTION EnableCursorKeys                       [pppsdemov3.bas] : 353
       1 FUNCTION WndProc                                [pppsdemov3.bas] : 377
       1 FUNCTION AddMainChildControls                   [pppsdemov3.bas] : 735
       0 FUNCTION ResourcesbyType                        [pppsdemov3.bas] : 974
       1 FUNCTION EnumResourceNames_CountProc            [pppsdemov3.bas] : 1005
       1 FUNCTION EnumResourceNames_FillProc             [pppsdemov3.bas] : 1011
       1 FUNCTION ExtractZlibDll                         [pppsdemov3.bas] : 1058
       1 FUNCTION GetSlideOrderTable                     [pppsdemov3.bas] : 1223
       1 FUNCTION StreamRichEditText                     [pppsdemov3.bas] : 1529
       1 FUNCTION StreamRichText_CallBack                [pppsdemov3.bas] : 1574
       2 FUNCTION SetButtonSubClass                      [pppsdemov3.bas] : 1627
       1 FUNCTION ButtonSubClassProc                     [pppsdemov3.bas] : 1659
       1 FUNCTION CheckVideoResolution                   [pppsdemov3.bas] : 1697
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     UN-USED GLOBAL VARIABLES
    --------------------------------------------------------------------------------
     g_sPicFileName                                     [SHOWPIC.INC] : 65
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     UN-USED LOCAL VARIABLES
    --------------------------------------------------------------------------------
     szResType                                          [pppsdemov3.bas] : 385
     szResName                                          [pppsdemov3.bas] : 385
     I                                                  [pppsdemov3.bas] : 391
     hCtrlTop                                           [pppsdemov3.bas] : 393
     hctrlNotTop                                        [pppsdemov3.bas] : 393
     xScale                                             [pppsdemov3.bas] : 742
     yScale                                             [pppsdemov3.bas] : 742
     hRez                                               [pppsdemov3.bas] : 744
     vRez                                               [pppsdemov3.bas] : 744
     hDC                                                [pppsdemov3.bas] : 744
     Z                                                  [pppsdemov3.bas] : 977
     sRawData                                           [pppsdemov3.bas] : 1192
     sDecompData                                        [pppsdemov3.bas] : 1192
     sRawData                                           [pppsdemov3.bas] : 1209
     sDecompData                                        [pppsdemov3.bas] : 1209
     pMem                                               [pppsdemov3.bas] : 1255
     fEventMask                                         [pppsdemov3.bas] : 1534
     E                                                  [pppsdemov3.bas] : 1539
     pDW                                                [pppsdemov3.bas] : 1577
    
    ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
     TOTAL REFERENCE COUNT - (Count, Name, [declared in File] : at Line number)
     Lists how many times the following has been called/used (zero = un-used)
    --------------------------------------------------------------------------------
     FUNCTIONS:
       1  IsScClose                                      [pppsdemov3.bas] : 100
       3  SetToolTip                                     [pppsdemov3.bas] : 206
       1  EnableCursorKeys                               [pppsdemov3.bas] : 353
       1  WndProc                                        [pppsdemov3.bas] : 377
       1  AddMainChildControls                           [pppsdemov3.bas] : 735
       0  ResourcesbyType                                [pppsdemov3.bas] : 974
       1  EnumResourceNames_CountProc                    [pppsdemov3.bas] : 1005
       1  EnumResourceNames_FillProc                     [pppsdemov3.bas] : 1011
       1  GetTempWorkFileName                            [pppsdemov3.bas] : 1032
       1  ExtractZlibDll                                 [pppsdemov3.bas] : 1058
       1  Uncompress                                     [pppsdemov3.bas] : 1113
       1  gzDecompressString                             [pppsdemov3.bas] : 1127
       0  LoadFile                                       [pppsdemov3.bas] : 1155
       1  GetPictureData                                 [pppsdemov3.bas] : 1166
       1  GetCommentText                                 [pppsdemov3.bas] : 1188
       1  GetRichEditSlideText                           [pppsdemov3.bas] : 1205
       1  GetSlideOrderTable                             [pppsdemov3.bas] : 1223
       1  RenderPicture                                  [pppsdemov3.bas] : 1252
       1  StorePicData                                   [pppsdemov3.bas] : 1415
       1  GetCommentFont                                 [pppsdemov3.bas] : 1441
       1  StreamRichEditText                             [pppsdemov3.bas] : 1529
       1  StreamRichText_CallBack                        [pppsdemov3.bas] : 1574
       1  GethLibRichEdit                                [pppsdemov3.bas] : 1596
       2  SetButtonSubClass                              [pppsdemov3.bas] : 1627
       1  ButtonSubClassProc                             [pppsdemov3.bas] : 1659
       1  CheckVideoResolution                           [pppsdemov3.bas] : 1697
    
     SUBS:
       3  LoadPic                                        [SHOWPIC.INC] : 138
      -1  LoadPic                                        [SHOWPIC.INC] : 266
    
     GLOBAL VARIABLES:
       4  g_hZlib                                        [pppsdemov3.bas] : 126
       2  g_dwProcZlibUncompress                         [pppsdemov3.bas] : 126
       1  g_hWnd                                         [SHOWPIC.INC] : 62
       7  g_hDC                                          [SHOWPIC.INC] : 63
      10  g_rct                                          [SHOWPIC.INC] : 64
       0  g_sPicFileName                                 [SHOWPIC.INC] : 65
    Well,I know PBCodec skips certain files, eg Win32API.INC.

    But as you can see, PBCodec only scanned 4296 lines, which I guess is approximately how many lines of "non-PB-supplied Windows' header file code" was required to create the application.

    MCM

    Leave a comment:


  • Pat Bullman
    replied
    Hello Chris,

    I’ve been away and just found this thread. Several thought hit me.

    Firstly, I think you should read up on what the API’s do and how they relate to Windows. Windows was designed so that all program output is handled by Windows, primarily through the GDI. When PowerBASIC sends, say, a command to display a bitmap on the screen the command is given to the relevant API to perform. There are PowerBASIC commands which do the same thing. These are wrappers for the API, there to simplify programming. BitBlt() and GetDc() are two API’s.

    Secondly, Windows functions on a messaging system where your application is advised of every action – like mouse movement, keyboard use or even another application starting. A program running under Windows must advise Windows of the function where messages will be sent. This is the basic interface between Windows and your program.

    I did a quick google and found:

    http://msdn2.microsoft.com/en-us/library/ms644927.aspx

    which looks like it explains Window’s messages (did not read the article). I can also scan a page from a Window’s programming bible that covers the topic well, if you wish (email me directly).

    Thirdly, Donald Darden makes a good point about the difference between a Windows and Console program. It’d be worthwhile ensuring you understanding the difference.

    Finally, PowerBASIC allows a programmer to program without direct reference to the API (or SDK). It takes care of all of Window’s requirements behind the scenes – you program as you would using QBasic. PowerBASIC also allow you to program directly with the API (using the SDK). Here you call a range of Windows functions directly. Either style can get the job done and there are pro’s and con’s for both.

    I see you’ve been shown several code samples . The only issue here is that some have been written using the API’s, others haven’t, some use both.

    Hope this helps.


    Pat

    PS: I’ve only recently come across to PowerBASIC myself and as part of my learning I converted many of my old programs to PowerBASIC. One of these was OwnerDraw.bas, which I developed to work out how to display bitmaps in button instead of using Windows native approach. It’s available for download in the Download section.

    Leave a comment:


  • Cliff Nichols
    replied
    Even if you're *not* going to choose PB as your main development tool, congratulations, you just purchased a reasonable priced 3rd party add on for VB. Compare it's capabilities and its price against other 3rd party products and you'll find its a bargain
    I know I started out that way, when my boss bought a copy for me to play with, and I was starting to realize there were things I could not do with MsComm, but PbComms I could do.

    Then I started realizing how easily I could build DLL's to support some of my larger projects in VB, then the next thing you know....I forgot VB existed
    (No more dependencies, no more bloat (unless I purposely put it in), and best of all a heck of a lot faster)

    Leave a comment:


  • Knuth Konrad
    replied
    Originally posted by Cliff Nichols View Post
    I can see why/where/what Chris Burgess is wary about a product that can not be tried out. But on the other hand, Chris, take the leap, you will NOT regret it.
    One thing I always mention (talking about PB/WIN): Even if you're *not* going to choose PB as your main development tool, congratulations, you just purchased a reasonable priced 3rd party add on for VB. Compare it's capabilities and its price against other 3rd party products and you'll find its a bargain.

    And who knows ... some day PB will become your main tool.

    Leave a comment:


  • Donald Darden
    replied
    PB/CC makes EXE files, with or without a console screen. It is best suited to procedural programming, similar to QBasic, and is the obvious growth product from old DOS programmers. It can use DLLs created by other development tools.

    PB/Win makes either DLL or EXE files. A console screen is also possible, but you have rely on the Windows API to create and manage it. Normally you are using Windows dialogues to receive input and post results. It also can use DLLs from other sources. In general, PB/Win programs are event driven in the manner of VB, rather than procedural oriented as with PB/CC and QBasic.

    Both products are about 95% compatible with each other, in syntax and capabilities. Thus, with a bit of added effort, you can write programs that can work with either. But generally the interest is to write to just one compiler's syntax and maximize its potential.

    PowerBasic includes inline assembler capabilities which is advantageous for maximizing performance or adapting code to specific needs. It lets you under the hood where windows is concerned, so you can tweak many aspects of your experience. You want fixed size screens, different fonts, custom colors, animation, sound, even Aero effects like you find with Vista? Somebody has found a way to do this already. Many third party tools exist, each intended to make the developers job ever easier, and most were themselves written in PowerBasic. It's that good.

    Looking around the PowerBasic forums, and searching for matches elsewhere on the Internet, you will discover a lot of interest, examples, sample code, and answers to questions you have not even thought of yet. Everything you asked for is within its scope. Yes, the manual makes for good reading, and can cover topics in a more orderly fashion, but the help files are adequate for learning much of the capabilities and syntax involved. And when you start a new phase of your project, a search of the forums will turn up literally scores of reference code examples to get you started. And if you are ever stumped about what to do next, just post a question and get input from others.

    Everything is strickly class A about PowerBasic, and if you run into something you aren't too happy about, you can send them an email, and they will review and respond. I just had a problem with REGEXPR, where I was trying to use this mask similar to this, and it would not work properly: ",| [^a-z0-9]", this probably means squat to you, but a Linux programmer would likely recognize something similar to this being used with awk. It defines a filter for processing a string, My problem was that it was not correctly catching a comma. Within a matter of hours I got a reply to use this instead: "(,)|( [^a-z0-9])", and an explanation why my code did not work from a PowerBasic staff member. It's sort of hard to top that, right?

    Leave a comment:


  • Cliff Nichols
    replied
    I can see why/where/what Chris Burgess is wary about a product that can not be tried out. But on the other hand, Chris, take the leap, you will NOT regret it.

    Even though some offered a collection (although a bit facetiously ) it should go to show that not only do we use it, but we SUPPORT it whole-heartedly.

    after all...if you look around the forums, and other forums, how often do you see "Owners of the company / Programmers themselves that use the product" that also peruse the forums, and offer help?????? I bet nearly none except here. (sorry Bob if I overstepped my bounds there)

    Just the support alone is worth the price of the product....(hmmm doesn't the price of the product somewhat represent the size of the product? aka: other languages charge Thousands of dollars for each and every version and yet PB is only a couple hundred or less for all the add-ons or tools you will ever need. (and from experience often FREE upgrades from version to version) not to mention COMPILE-ABLE between versions rather than force you to spend another couple grand just to view code written in a newer version (I will leave other so called languages out of this (Ahem...NI...Ahem)

    In fact Chris....if you do not like the product, I will personally buy it back from you. (Assuming PB will let me register it under my name, no harm no foul)

    Leave a comment:


  • Steve Rossell
    replied
    I would use Edwin's source as it is the same as I was thinking, he is using StretchBlt and I said to use BitBlt. StretchBlt will work with any size image and dialog and BitBlt will only work with a fixed image and dialog size. When you purchases the compiler, you will receive a help file that describes the API calls such as StretchBlt and BitBlt.

    Leave a comment:


  • Rodney Hicks
    replied
    For those that have been unfortunate enough to live in this day and age without the abilities of Power Basic should look at "Built with Power Basic" on PB's homepage.

    It shows a good range of programming accomplishments and should alleviate any worries about PB's capabilities. It's the programmer's range capabilities that are most likely the limiting factor.

    Rod

    Leave a comment:


  • Michael Mattias
    replied
    Any chance of posting the source (or even partial source) so I can see how complex an app like that demo is?
    Posting, no. Licensing, maybe.

    But I told you in the linked thread how I did everything, which was mostly by appropriating code written by others, code I got here!

    Leave a comment:


  • Chris Holbrook
    replied
    Originally posted by Chris Burgess View Post
    am I right in assuming that it draws ...
    Yes.

    Where can we send funds to help you buy the compiler?

    Leave a comment:


  • Edwin Knoppert
    replied
    1) Finally purchase

    2) Have you even looked at the stuff i posted, it's fairly complete ans small..
    Just a few slight modifications

    3) No one can help you if don't have a compiler at some point.

    Leave a comment:


  • Chris Burgess
    replied
    Originally posted by Steve Rossell View Post
    Chris,

    Maybe the easiest method would be to use BitBlt to draw the bitmap directly onto the dialogs DC (GetDC). This can be done in five or six lines of code.
    Hi Steve,
    Not sure what you mean by BitBlt - the online manual says "no topic found". Same result for Getdc.

    Not sure if you have been following this thread from the start - my programming background is microcontrollers, not PC / Windows.
    We are looking at PBWin for making unrelated PC apps, after looking at existing software which is too complex/buggy/bloated for what we want to achieve.
    It's a little harder than normal because there is no "demo" version of PB, so far we've got some examples of source code and one executable, but none together...

    Any chance of posting the "five or six lines of code" please?

    Thanks for the reply,
    Chris.

    Leave a comment:


  • Chris Burgess
    replied
    Chris H (and others)

    I can kind of follow that code - am I right in assuming that it draws 10 pictures that individually change randomly at set intervals, and change immediately when the image is clicked on?

    I've saved your (and others) code, and I'll study it and compare it with the online documentation over the next few days.

    Thanks,
    Chris

    Leave a comment:


  • Chris Burgess
    replied
    Michael,

    Had a look at that ppstour demo on the linked site, and thats close to what I'm hoping to achieve. At least now I have seen a working application...
    For the size of it (only one file, and under half a meg) that's pretty much convinced me that PB is the way to go. One local guy here made a "hello world" type program in VBx2008 that, with runtimes and the installer, was nearly half a GIG! I new that "modern" compilers made bloat, but I didn't expect that much of a difference.

    Any chance of posting the source (or even partial source) so I can see how complex an app like that demo is?

    Regards,
    Chris

    Leave a comment:


  • Chris Holbrook
    replied
    it's a game!

    Let's add some functionality to the images!
    You will need two images, preferably different. Call one good.bmp and the other evil.bmp. Run the application below. Will good prevail? can evil ever be eradicated?

    Code:
    ' image game, you need 2 images, "good.bmp" and "evil.bmp"
    ' click on an image to change it
    ' while the timer also plays!
    ' Chris Holbrook 21-Apr-2008
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "WIN32API.INC"
    %IDD_DIALOG1 =  101
    %IDC_MYIMAGE = 1001
    %our_timer = 100
    '--------------------------------------
    CALLBACK FUNCTION ShowDIALOG1Proc()
        LOCAL i AS LONG
        STATIC hbmp(), hbmpGood, hBMPEVIL AS LONG
    
        SELECT CASE AS LONG CBMSG
            CASE %WM_INITDIALOG
                settimer CBHNDL,%our_timer,750,0
                hBmpGood = LoadImage(0, "good.bmp", %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE)
                hBmpevil = LoadImage(0, "evil.bmp", %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE)
                REDIM hbmp(0 TO 9) AS STATIC LONG
                FOR i = 0 TO 9
                    hbmp(i) = hBmpEvil
                    CONTROL SEND CBHNDL, %IDC_MYIMAGE + i, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp(i)
                NEXT
            CASE %WM_COMMAND
                i = CBCTL - %IDC_MYIMAGE
                IF hbmp(i) = hBmpEvil THEN
                    hbmp(i) = hBmpGood
                ELSE
                    hbmp(i) = hBmpEvil
                END IF
                CONTROL SEND CBHNDL, %IDC_MYIMAGE + i, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp(i)
            CASE %WM_TIMER
                i = RND(0,9)
                IF hbmp(i) = hBmpEvil THEN
                    hbmp(i) = hBmpGood
                ELSE
                    hbmp(i) = hBmpEvil
                END IF
                CONTROL SEND CBHNDL,%IDC_MYIMAGE + i, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp(i)
    
            CASE %WM_DESTROY
                killtimer CBHNDL, %our_timer
        END SELECT
    END FUNCTION
    '--------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL i, lRslt AS LONG
        LOCAL hDlg  AS DWORD
    
        DIALOG NEW hParent, "Good vs Evil", 20, 20, 310, 360, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
            %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT _
            OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
        FOR i = 0 TO 9
            CONTROL ADD LABEL, hDlg, %IDC_MYIMAGE + i, "", _
                    20 + ( (i MOD 2) * 135), 2 + ((i MOD 5)*70), 130, 70, _
                    %WS_CHILD OR %WS_VISIBLE OR %SS_BITMAP OR %SS_CENTERIMAGE OR _
                    %SS_NOTIFY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING
        NEXT
        DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        FUNCTION = lRslt
    END FUNCTION
    '===================================
    FUNCTION PBMAIN()
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION

    Leave a comment:


  • Edwin Knoppert
    replied
    Here is how i did it, with PwrDev though, so you'll need to modify it slightly:
    Code:
    IMAGE1 BITMAP "%windir%system32\setup.bmp"
    Code:
    Global pBMIH As BITMAPINFOHEADER Ptr
    Code:
        Local hRes As Long
        Local hMem As Long
        hRes = FindResource( VD_App.hInstance, "IMAGE1", ByVal %RT_BITMAP )
        hMem = LoadResource( VD_App.hInstance, hRes )
        pBMIH = LockResource( hMem )
    Code:
        Case %WM_ERASEBKGND
    
            StretchDIBits( nCbWparam _
                , 0, 0, @pBMIH.biWidth, @pBMIH.biHeight _
                , 0, 0, @pBMIH.biWidth, @pBMIH.biHeight _
                , ByVal CLng( pBMIH + Len( @pBMIH ) ) _
                , ByVal pBMIH, %DIB_RGB_COLORS, %SRCCOPY )
    
            Function = 1
            Cancel = 1
    
        Case %WM_PAINT
        Case %WM_TIMER

    Leave a comment:


  • Michael Mattias
    replied
    Question: Can we either load a BMP and put it to the form background, or if that's impossible, can we have more than one background image in a RESource file?
    ..
    [answer given=YES]
    ...
    Lots of image files and worried about executable size? See:
    One From Column A, One from Column B..

    That post, by the way, should show you just how many different pieces of code have already been contributed to the source code forum and how you can put them together.

    Also that you are going to have to put pieces together, since nobody is going to create exactly what you want except you...unless you engage someone to do it for a fee.

    PS:
    I know I posted this somewhere here earlier, but here's the resource file for the application mentioned in my link:
    Code:
    // pppsdemov3.rc
    //
    // 10.01.04 1.0.0  Original
    // 11.01.04 1.0.1  Corrected some typos in richtext and reworded one comment here (database search)
    // 11.08.04 1.0.2  Changed claims summary report to version which shows "ALLOWED" instead of "COVD CHG"
    // 06.09.05 2.0.0  Demo for version 3.0
    // 12.03.07 2.1.0  Demo for version 3.2 very few changes needed
    
    #include "resource.h"
    
    #define COPYRIGHT_SYMBOL "\251"
    #define REGISTERED_SYMBOL "\256"
    #define TRADEMARK_SYMBOL  "\153"
    
    //  ===================================================//
    //      STANDARD VERSION RESOURCE AND #defines
    // Version resource last item in this file
    //  ===================================================//
    #define VERSION_MAJOR       2
    #define VERSION_MINOR       1
    #define VERSION_BUILD       0
    #define VERSION_LITERAL     "Version 2.1.0\0"
    #define VERSION_DATE       " December 2007\0"
    #define VERSION_PURPOSE    " Provider Payment Partner Demonstration\0"
    #define PROGRAM_NAME       " PPPSTOUR"
    #define PRODUCT_NAME       "Provider Payment Partner System\0"
    #define VERSION_TRADEMARKS "Provider Payment Partner is a trademark of Tal Systems Inc. Racine WI\0"
    
    PROGRAM  ICON     pppsabr3.ico
    
    // FOR THE TOOLBAR BUTTONS
    ARROWR     BITMAP    arrow_right.bmp
    ARROWL     BITMAP    arrow_left.bmp
    STOP       BITMAP    stopsign3.bmp
    TSI        BITMAP    tal_white_90x45.bmp
    // Background brush for picture control
    MDICPATT  BITMAP    ppps_green_bar.bmp
    
    // ZLIB.DLL Compression/Decompression Library
    
    COMP       COMP      zlib.dll
    
    //======================================//
    // SLIDES TO BE SHOWN FOR PRESENTATION
    //=====================================//
    
    //  Defines used to order the slides at runtime...
    //  Each picture to be shown has two entries, a "Slide" entry and a "Comment" entry,
    //  The comment text appears with each slide
    
    #define crlf                  0x0a0d      //  inverted because stored as WORD
    
    #define rpt_provider_eor         101
    #define rpt_patient_eor          102
    #define rpt_claims_summary       103
    #define rpt_remit_summary        104
    
    #define scr_database_search      201
    #define scr_select_remittance    207
    #define scr_main                 211
    #define scr_olv_claimlist        212
    #define scr_olv_selclaim         213
    #define scr_system_setup         215
    #define scr_report_setup         216
    #define scr_reportcenter         218
    
    
    #define txt_home_screen          301
    #define txt_prov_benefits        302
    #define txt_thankyou             309
    #define txt_features             310
    
    
    // To define the type of "picture" which may be either a picture or a richtext string
    // These equates are used in the program as well as here.
    #define  is_picture              301
    #define  is_richtext             305
    
    
    ///===========================================================================////
    ///  TABLE TELLLING US WHAT TYPE AND IN WHAT ORDER SLIDES ARE TO BE PRESENTED
    //   SLIDE can be type is_picture or is_richtext
    //   Type will come back with type in HIWRD of long integer, since all these
    //   values here are stored as 16-bit integers.
    ///==========================================================================////
    
    PICTYPE     TABLE
    BEGIN
            txt_home_screen, is_richtext,
            txt_prov_benefits, is_richtext,
            scr_system_setup,is_picture,
            scr_report_setup,is_picture,
            scr_main,is_picture,
            scr_reportcenter,is_picture,
            scr_olv_claimlist,is_picture,
            scr_olv_selclaim,is_picture,
            scr_database_search,is_picture,
            rpt_remit_summary, is_picture,
            rpt_claims_summary, is_picture,
            rpt_provider_eor,is_picture,
            rpt_patient_eor,is_picture,
            txt_features,is_richtext,
            txt_thankyou, is_richtext
    END
    
    
    // TEXT SLIDES ( richtext documents)  which these do not have comments...
    txt_home_screen                  SLIDE     tsi_presents_v3.rtf
    txt_prov_benefits                SLIDE     prov_benefits.rtf
    txt_thankyou                     SLIDE     thank_you.rtf
    // txt_features                     SLIDE     std_features.rtf
    // next file is bulleted created by MS-Word as Rich text 12/3/07
    txt_features                     SLIDE     std_features_32m.rtf
    
    //MAIN REMITTANCE PROCESSING SCREEN
    scr_main      SLIDE       zc_remitcenter_main.bin
    scr_main      COMMENT
    BEGIN
      "This is the main PPPS remittance processing screen. Either 'Open by File Name' or 'Open by Payer Name' ",
      "may be used o select the name of the payer's remittance file to be processed.",
      "As that remittance file is opened, the user is ",
      "presented with this summary showing remittance advice documents found in that file.",
      crlf,
      "On this and all other screens of the PPPS, the user may select the 'datasource', which is ",
      "the destination for remittance information storage or source for reports and inquires;",
      " as well as direct that print report output be sent either directly ",
      "to a named printer or to the What-You-See-Is-What-You-Get print previewer."
    END
    
    // REPORT CENTER INTRODUCED IN VERSION 3.0
    
    scr_reportcenter      SLIDE    zc_ppps_report_center_32.bin
    scr_reportcenter      COMMENT
    BEGIN
     "The PPPS ReportCenter is the central location from which all print reports are created. A toolbar ",
     "shows all available standard and user-tailored 'plug in' reports are available, and a summary description "
     "of each report is shown.",
     crlf,
     "From this screen the user may also launch the Online Remittance Viewer.",
     crlf,
     "Remittances may be filtered by date, or all remittances in the database may be included."
    END
    
    // ON LINE REMITTANCE INQUIRY CLAIMLIST SCREEN
    scr_olv_claimlist     SLIDE    zc_ppps_olv_claim_list_300.bin
    scr_olv_claimlist     COMMENT
    BEGIN
     "When a payer's remittance includes individual claim adjudications, the on-line remittance inquiry presents ",
     "this list of claims. The list may be sorted by any of the columns.",
     crlf,
     "From this screen the user may mark or unmark one or more claims, or all claims at once, select a report ",
     "from the toolbar and generate that report, sending the report either directly to a printer or to the ",
     "What-You-See-Is-What-You-Get Print Previewer."
    END
    
    // ON LINE REMITTANCE VIEWER SELECTED CLAIM SCREEN (New in 3.0)
    scr_olv_selclaim     SLIDE    zc_ppps_olv_sel_claim_300.bin
    scr_olv_selclaim     COMMENT
    BEGIN
     "The Online Remittance Viewer's detailed look at the claim currently selected on the claim list screen looks ",
     "like the Provider's Explanation of Remittance Print Report.",
     crlf,
     "The left and right arrow keys advance to the prior or next claim in the claim list in the order in which ",
     "the claims are currently sorted."
    
    
    END
    
    // ===========  PROVIDER'S EOR REPORT ==============================
    rpt_provider_eor       SLIDE           zc_report_provider_eor.bin
    rpt_provider_eor       COMMENT
    BEGIN
     " This is the primary detail report which providers will use to post payments to patient accounts, ",
     " prepare COB claims or create statements for patient responsibility amounts. Any service line overrides such ",
     "as procedure code, service line rendering provider or payment remark codes are shown after each service line."
    END
    
    
    
    //========= PATIENT'S  EOR REPORT ================================
    rpt_patient_eor      SLIDE   zc_report_patient_eor.bin
    rpt_patient_eor      COMMENT
    BEGIN
      "The Patient version of the Explanation of Remittance is a 'stripped down' version of the Provider version;"
      " it omits information of no interest to the patient, such as the payer's check number and date, "
      "and adds payer contact information to assist your patients if they must contact the payer.",crlf,
      "Although you may create Patient EORs for all claims in a remittance at one time, each EOR  begins on its own Page One."
    END
    
    
    //========= CLAIMS SUMMARY REPORT ================================
    rpt_claims_summary      SLIDE   zc_report_claims_summary.bin
    rpt_claims_summary      COMMENT
    BEGIN
      "The Claims Summary Report provides important summary information about each claim adjudicated in the payer's ",
      "remittance.", crlf, "Column eight (in example, the column with PENALTY AMT at the top) is reserved for four ",
      "user-defined adjustment buckets: both the column header and which adjustments reason codes are included in ",
      "these columns are specified by the user."
    END
    
    //========= REMITTANCE SUMMARY REPORT ================================
    rpt_remit_summary      SLIDE   zc_report_remit_summary.bin
    rpt_remit_summary      COMMENT
    BEGIN
      "The Remittance Summary Report provides a concise summation of a payer's remittance.", crlf,
      "The provider-level adjustments (not applicable to any particular claim) and the control ",
      "totals shown toward the bottom of this page are shown on all remittance reports except the Patient's ",
      "EOR Report."
    END
    
    //========= SCAN AND MAP REPORT ================================
    // REMOVED FROM TOUR FOR VERSION 3.0
    ///rpt_scan_map           SLIDE   zc_report_scan_map.bin
    ///rpt_scan_map         COMMENT
    ///BEGIN
    ///  "This report is automatically produced each time 'Scan' or 'Scan and Store' is selected from the main ",
    ///  "processing screen. Each payer's remittance stored in the database is assigned a 'remittance number' ",
    ///  "which is used to select a remittance for further inquiry or report creation."
    ///END
    
    
    //  ===========SYSTEM AND USER SETUP  SCREEN ======================
    //  only change of a file name into the resource in here for demo version 2.1 (PPP version 3.2)
    //  several richtext files have had text updated
    //
    //scr_system_setup         SLIDE        zc_ppps_system_setup_300.bin
    scr_system_setup         SLIDE        zc_ppps_system_setup_320.bin
    scr_system_setup         COMMENT
    BEGIN
     "This is the screen used for basic system setup. Default folders for files, data source for input and output,"
     " Provider Name as it is to appear on reports, default printer name, What-you-see-is-what-you-get printer "
     "options, duplicate remittance handling and sort order for claims within remittances may all be set here. "
     "All options may be changed at any time and immediately affect reports."
    END
    
    // =============== USER-DEFINED ADJUSTMENTS SETUP SCREEN =============
    scr_report_setup        SLIDE        zc_ppps_user_report_options.bin
    scr_report_setup        COMMENT
    BEGIN
     "This screen is used to set up the adjustment reason codes used to group varous payer adjustments ",
     "into user-defined 'buckets.'",
     crlf,
     "The four user-defined buckets appear on the Claims Summary Report; the discount appears on both the "
     "Provider's Explanation of Remittance Report and the Remittance Summary Report.",
     crlf,
     "This screen also controls if and where the text for payment remark codes appears on the Provider ",
     "and Payer Explanation of Remittance Reports."
    END
    
    
    
    // =============== DATABASE SEARCH SCREEN =============================
    scr_database_search    SLIDE        zc_ppps_database_search_32.bin
    scr_database_search    COMMENT
    BEGIN
    "After a payer's remittance has been stored in the database, the user can locate all payment information using ",
    "any of several key values."
    crlf,
    " When the desired claim payments are located, one click is all it takes to generate an EOR or Claims Summary Report."
      crlf,
      " This feature is extremely useful assisting patients to understand what their insurance paid, and more "
      "important, what their insurer did not pay.",
       crlf,
      "Searches may be filtered by date, or all remittances in the database may be included."
    
    END
    
    // =============== SELECT A REMITTANCE FOR SOMETHING SCREEN =============================
    // DROPPED FROM TOUR FOR VERSION 3.0
    // scr_select_remittance   SLIDE        zc_ppps_select_remittance_221.bin
    // scr_select_remittance   COMMENT
    //BEGIN
    //"This screen is used any time a remittance is selected ",
    // "for reporting, using the on-line-inquiry or deleting old remittances ",
    // "when no longer needed or any other PPPS function requiring a 'remittance number'. "
    // "The list of available remittances may be sorted by any of the columns shown."
    //END
    
    VS_VERSION_INFO VERSIONINFO
    FILEVERSION    VERSION_MAJOR, VERSION_MINOR, 0, VERSION_BUILD
    PRODUCTVERSION VERSION_MAJOR, VERSION_MINOR, 0, VERSION_BUILD
    FILEOS VOS_WINDOWS32
    FILETYPE VFT_APP
    //FILETYPE VFT_DLL   // << FOR DLLs
    BEGIN
      BLOCK "StringFileInfo"
      BEGIN
        BLOCK "040904E4"
        BEGIN
          VALUE "CompanyName",      "Tal Systems Inc.\0"
          VALUE "FileDescription",  VERSION_PURPOSE
          VALUE "FileVersion",      VERSION_LITERAL
          VALUE "Author",           "Michael Mattias, Tal Systems Inc.\0"
          VALUE "InternalName",     PROGRAM_NAME
          VALUE "LegalCopyright",   " \251 Michael C Mattias\0"
          VALUE "LegalTrademarks",  VERSION_TRADEMARKS
          VALUE "ProductName",      PRODUCT_NAME
          VALUE  "VersionDate",      VERSION_DATE
        END
      END
    END
    
    
    //  END OF FILE
    Last edited by Michael Mattias; 21 Apr 2008, 04:20 PM.

    Leave a comment:


  • Chris Holbrook
    replied
    ...or even load from a file as this working example (44 lines including comment & whitespace) shows. After an example by Kev Peel, SDK nowhere in sight.

    Code:
    #COMPILE EXE
    #DIM ALL
    #IF NOT %DEF(%WINAPI)
        #INCLUDE "WIN32API.INC"
    #ENDIF
    
    %IDD_DIALOG1 =  101
    %IDC_MYIMAGE = 1001
    
    '--------------------------------------
    
    CALLBACK FUNCTION ShowDIALOG1Proc()
        LOCAL hbmp AS LONG
    
        SELECT CASE AS LONG CBMSG
            CASE %WM_INITDIALOG
                hBmp = LoadImage(0, "MYIMAGE.BMP", %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE)
                CONTROL SEND CBHNDL, %IDC_MYIMAGE, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp
    
            CASE %WM_COMMAND
                SELECT CASE AS LONG CBCTL
                    CASE %IDC_MYIMAGE
    
                END SELECT
        END SELECT
    END FUNCTION
    '--------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
        LOCAL lRslt AS LONG
    
        LOCAL hDlg  AS DWORD
    
        DIALOG NEW hParent, "file to image", 161, 113, 201, 121, %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
            %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT _
            OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
        CONTROL ADD LABEL, hDlg, %IDC_MYIMAGE, "", 20, 5, 155, 100, %WS_CHILD OR %WS_VISIBLE OR %SS_BITMAP OR %SS_CENTERIMAGE OR _
            %SS_NOTIFY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING
        DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt
        FUNCTION = lRslt
    END FUNCTION
    '===================================
    FUNCTION PBMAIN()
        ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION

    Leave a comment:


  • Steve Rossell
    replied
    Chris,

    Maybe the easiest method would be to use BitBlt to draw the bitmap directly onto the dialogs DC (GetDC). This can be done in five or six lines of code.

    Leave a comment:


  • Chris Holbrook
    replied
    Originally posted by Edwin Knoppert View Post
    In VB this was/may been a property, PowerBASIC requires plain SDK and means that you'll need to load the image and draw it yourself.
    But.. nothing is impossible, just more work.

    Using the IPicture or even better, the gdi plus functions you can draw on a window without to much work (or by plain winapi).
    There are examples of GDIplus in the forums too, code that can be cut & pasted to pick up an image from a file and place it in a control at a given size, so the picture selection can be changed without having to recompile or to use a resource editor. So don't be disheartened by "just more work" - the work has already been done and the bill is $0.00.

    Leave a comment:

Working...
X