|
Pages: [1] 2 3
|
 |
|
Author
|
Topic: Very early GUI stuff (Read 4133 times)
|
|
|
|
|
|
|
fsw
Guru
 
Posts: 251
|
can you make it XP'ish? To get this to work you need to have a 'myapp.exe.manifest' file with the following text: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CompanyName.ProductName.YourApp" type="win32" /> <description>Your application description here.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly>
the fields don't need to be set with your apps infos. The bad thing about this external file is: if the manifest file is corrupted your application won't start at all. You have to delete the manifest file first. Better is to have the manifest file converted to a resource with this setting (normally a myapp.rc file): 1 24 "WindowsXP.Manifest"
where WindowsXP.Manifest is the name of the xml file, and have it linked into the exe.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|
fsw
Guru
 
Posts: 251
|
...and you're correct CGI Joe, that stuff is for .net and wouldn't have any effect here in FB.
Are you refering to what I posted? If so, than I'm sorry, because the 2 ways I described are exactly how it works on WinXP (without the .net stuff) I've done it for years. QUESTION: has anybody a working CreateFile/OpenFile/ReadFile (win api) example working? Somehow the compiler tells me some errors because I used: ReadFile (hFile, pBuffer, NumBytes, pBytesRead, 0) the zero was not accepted. had to change this line: Declare Function ReadFile Lib "kernel32" (ByVal hFile As Integer, lpBuffer As ANY, ByVal nNumberOfBytesToRead As Integer, lpNumberOfBytesRead As Integer, lpOverlapped As ANY ) As Integer 'OVERLAPPED) As Integer
in kernel32.bi. The last parameter IS OVERLAPPED type - but the compiler doesn't accept a zero (regarding Win32 help you can use both for different purposes). In Dev-Cpp it works as OVERLAPPED type and zero... What's going on?
|
|
|
|
|
Logged
|
|
|
|
fsw
Guru
 
Posts: 251
|
Welp, I got command buttons almost fully working, although not yet XP-style.  You can add: SendMessage ( hWnd, WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT),0)
after creating your controls (hWnd is the handle of your control). This way you get the normal GUI font (instead of the bold system font) 
|
|
|
|
|
Logged
|
|
|
|
fsw
Guru
 
Posts: 251
|
Just wanted to let you know that I tested what I said above and it works even with fb Example: take the winhello.bas example file and add this: hButton = CreateWindowEx (0, "Button", "Button 1", WS_CHILD OR WS_VISIBLE, 10, 10, 100, 20, hWnd, 0, 0, 0)
before this: ShowWindow hWnd, iCmdShow UpdateWindow hWnd
save the bas file. Now create a winhello.exe.manifest file with the information that I posted above (the xml code). Start winhello.exe That's it. If you delete winhello.exe.manifest (or rename it) than you will have a classic button. Now the last thing to do, is to add the winhello.exe.manifest with ID 24 as a resource to the exe. Because if winhello.exe.manifest is corrupted or not a proper xml file, than you will see nothing. As a test copy the winhello.exe binary file to winhello.exe.manifest. Now start winhello.exe You get a windows error message: "Error executing program!" That's it because winhello.exe.manifest is now a binary file without xml information. Winhello.exe won't start anymore. Delete winhello.exe.manifest. Now start winhello.exe, it has a classic button. BTW: Like I said above, for a standard button font add this: SendMessage ( hButton, WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT),0)
after the buttoncreation. The value of the DEFAULT_GUI_FONT constant is 17. Actually this: UNSPECIFIED_FONT = 15 DEFAULT_GUI_FONT = 17
should be added to gdi32.bi Take care
|
|
|
|
|
Logged
|
|
|
|
|
|
adosorken
*/-\*
    
Posts: 3654

|
Okay, I got a couple of questions for anyone out there who's got some experience in raw GUI programming: 1. The combobox will not display the dropdown icon, although it will function as normal when I send messages to add new text items, and I can scroll through the items using the keyboard's cursor keys. Do I have to draw this in myself? The MSDN makes no mention of it...in fact, as usual, it's quite vague on the subject. 2. With editboxes, there are no scrollbars, even when multiline and the scroll types are set. I see this on the MSDN: "Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages.". Maybe I'm a bleedin' idiot, but this doesn't make a whole lot of sense to me. Can someone explain wtf I have to do to get scrollbars in editboxes in plain English?  In any event, I got more controls working...somewhat. As before, I still don't have a lot of time to work on this so it's mainly just pick and tear at what I can, but here's a newer screenie:  With all of this working to some exent thus far, I've already conceptualized a method of GUI abstraction that hopefully will work. Once the controls are brought "under control", so to speak, it can be created so everyone can have true event-based GUI support under FreeBASIC. EDIT: New user32.bi released (v1.05, includes new combobox message constants, allowing stuff like adding items to comboboxes), and allfbapi was updated.
|
|
|
|
|
Logged
|
'd knock on wood, but my desk is particle board.
|
|
|
|
|
|
|
|
|
|
|
|
Pages: [1] 2 3
|
|
|
|
|