select case ( mesg ) case (WM_CREATE) ihWndstatus = CreateStatusWindow (IOR(WS_CHILD, & WS_VISIBLE), " "C, hWnd, IDC_StatusBar) iParts = 3 bRegValuesEmpty = TRUE MainWndProc = 0 return case (WM_SIZE) cxClient = loword(lParam) cyClient = hiword(lParam) iret = GetWindowRect(ihWndStatus,RectStatus) iSBheight = Abs(RectStatus%bottom-RectStatus%top) iret = GetClientRect(hWnd,rcClient) cxWidth = rcClient%right/iParts iStep = cxWidth
I have been reading the posts in the forum and have seen mention of IFLOGM/DFLOGM. I'm also reading the book "Compaq Visual Fortran" which only seems to present information on QuickWin and Win32... no mention of IFLOGM/DFLOGM in the index. I'm guessing this is something that is particular to the Intel version of Visual Fortran and not the Compaq version. The help files for IVF present some information about DFLOGM/IFLOGM, but it's a little hazy on what I can or cannot do with the "flavors".
链接已复制
The bottom line is, DFLOGM and QuickWin are independent and unrelated libraries, both built on top of Windows APIs (which are kinda difficult to use). CVF docs confused the issue by sticking them together in the same "Using QuickWin" chapter, although DFLOGM is totally independent of QW. Also, since both are built on top of Windows API, you can call Windows API functions for "their" objects. For example, API calls MoveWindow(GETHWNDQQ(QWIN$FRAMEWINDOW),...) and MoveWindow(Dlg%Hwnd,...) will work as expected on QuickWin frame window and TYPE(Dialog) window. The reverse is not true -- if you created a window using hWnd=CreateWindow(...) or hWnd=DialogBox(...), you can't call SetWindowConfig or DlgGet for it.
Does it make things clearer?
Yes, it does. Thanks!
I've worked with Visual Basic and C++, and they don't seem to have the different variances that Visual Fortran has. When I start a Visual Fortran application, it asks if I want a QuickWin or a Win32 application. Which do you select? The problem is that I see examples in the book and in the help that suggests that there might be some sort of crossing between the two, but I'm not sure how to perform something in one versus the other and vice versa.
For example, I ran into a problem with QuickWin that I wasn't able to modify the status bar. I found an example in the book that was able to modify the status bar, but it was in a Win32 application. With the Win32 application, I'm running into a problem where I need to perform an action if a radio button is selected, but it seems like it is done in DFLOGM which seems to be different than how I have everything coded which is Win32. That's the example that I pasted at the top of this thread.
I'm getting confused on two things... How should my application be built, Win32 or QuickWin, that would give me the flexibility that I need?... and... How do I do what I need to do in that particular option? It would be great if there was only one path to take for programming in Visual Fortran... not a QuickWin version or a Win32 version... just a simple this is Visual Fortran. With other programming languages you have DLLs, COM objects, etc... but those are add-ons to your main code... not different ways of coding the main code like there is with Visual Fortran. For me coming from VB and C++, this is confusing.
Chad
Well, Win32 gives you all the flexibility you need... and then some. It's a bit difficult to use, though. But I can't really answer the question which one is more suitable for you, as I don't know your needs. QuickWin is simple but also limited and often sluggish. DFLOGM is confined to dialogs, but you can use it freely in a Win32 application (and QuickWin, of course). For example, VF Application Wizard will give you a DFLOGM-based code if you select "Win32 application/Dialog-based".
For example, In DFLOGM, you will get the radio button status using DlgGet(IDC_RADIO, bState). In Win32, you can query SendDlgItemMessage(hDlg, IDC_RADIO, BM_GETCHECK, ...).
I understand your confusion, but, sorry I can't be more specific at the moment; the situation is as follows: if you decide to learn "pure" Win32 first, you will get a broad and deep knowledge, but your learning curve will be lean, and you won't get results (working applications) quickly. In QuickWin or DFLOGM, you get results quickly, but your flexibility is limited. For what it's worth, I started with QW/DFLOGM and gradually added Win32 code (and knowledge) to it. (applying APIs on GETHWNDQQ, then subclassing, then...).
You can check out my home page www.xeffort.com for yet another solution (which I deem the right compromise between complexity and power, but of course I'm biased). Yes, it will give you a "Fortran Xeffort Application" in New/Project :-). In any case, you can take a look at "Miscellaneous samples" and Xeffort samples. Maybe it would make things somewhat clearer...
QuickWin is not meant as the ultimate solution for everyone and it has its limitations. But all the other choices require some re-thinking of your application if you want a full Windows UI. (As Jugoslav says, adding dialog boxes is pretty simple for any application type, even console.)
The piece of code you postedlooks likeclassic win32 stuff, an excerpt from a main window procedure that handles the 'message loop' that is required when operating. Messages such as WM_COMMAND, WM_PAINT, WM_SIZE etc.
Quickwin sets up its own window procedure and runs its own message loop to control all the windows that you can create in Quickwin, from a seperate thread. In Quickwin, all you do is run a program in its own thread to create and modify windows and assign 'call back' routines to each menu item that you want to control. Your main program then goes to sleep ( you will find a 'do nothing forever' loop inside the Quickwin examples, which is OK since the main work is being done in a seperate thread you have no direct control over).These call backs are then called from the Quickwin window procedure.
The Quickwin status bar is a single window whose text can be changed. (I will post the interface to the routine required tomorrow). If you want a more complicated status bar, then you will have to go the WIN32 way I think.
What about a third party package such as Winteracter, in comparison to QuickWin/DFLOGM/Win32?
I am working on converting a set of old Fortran code to the one with a lot of dialog I/O and graphic output. When I used Lahey Fortran before I moved to IVF, I found Winteracter easy to use, probably because the package came with many sets of sample code for practical application.
After I switch to IVF, I started using QuickWin. I am still struggling to figure out which basic routines I need to plot a simple x-y curve. I could not find sample programs except limited ones in xeffort.com. I guess I could make it soon but I am not sure whether there is any easy way to plot scattering x-y point with a special symbol.
Would anyone suggest me using something like Winteracter for easier work?
Wen
Look at the Scigraph sample in the samples I posted at the top of this forum. It is QuickWin.
