|
Post by Walt Decker on Nov 11, 2021 10:26:35 GMT -5
Dennis:
I am in the process of doing two things: 1) adding a font tool to the tab control and 2) making a little demo for your with copious comments. I am testing the font tool now.
Do not worry about the STYLEBITS. Use this after adding the tabs:
WS.CHILD = HEXDEC("&H40000000") WS.VISIBLE = HEXDEC("&H10000000") WS.CLIPCHILDREN = HEXDEC("&H02000000") WS.DLGFRAME = HEXDEC("&H00400000")
' Style = WS.CHILD OR WS.CLIPCHILDREN OR WS.VISIBLE OR WS.DLGFRAME
CALLDLL #TAB, "SetWinStyle", _ hDmoTab AS ULONG, _ '<--- handle of tab control 0 AS LONG, _ '<--- zero based tab index Style AS ULONG, _ '<--- new window style 0 AS ULONG, _ '<--- no extended style Idx AS VOID '<--- no return value
CALLDLL #TAB, "SetWinStyle", _ hDmoTab AS ULONG, _ 1 AS LONG, _ '<--- tab index Style AS ULONG, _ 0 AS ULONG, _ Idx AS VOID '
If you do not like the raised edge, drop WS.DLGFRAME
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 11, 2021 11:36:02 GMT -5
Hi Walt Thanks for your reply! I am really enjoying adding your TAb control to my programs - it opens up a lot of opportunities! I had a TAB Control in the previous BASIC that I used so when converting, I removed it. I am now putting it back. In testing, a more serious problem cropped up. I found that the TEXTBOX control will not accept input. The TEXTEDITOR Control works fine. I thought it was something I was doing wrong in my program so I went back to your demo program and added a BUTTON and TEXTBOX to your first tab. The button worked, but the TEXTBOX does not accept data. Could this be a bug or something? I have given the modified demo below. II will try the Style thingie and give you feed back. This is really a great control and should be included in LB5. Regards Dennis Attachments:TabTest.bas (2.98 KB)
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 11, 2021 11:50:47 GMT -5
Ahhhh the STYLE thingie worked AND after changing the style, the TEXTBOX also started to work.
I is obviosly something to do with the window styles... I really have to get to grips with it!
Thanks Walt!!
|
|
|
Post by Walt Decker on Nov 11, 2021 13:08:08 GMT -5
Ran into a small challenge with the font tool. It will be a bit longer, but the way I have it arranged, you should be able to change the font for the tabs at any time.
Glad it is working for you. As far as I know you are the only person using it and really running it through the paces. I do appreciate it.
|
|
|
|
Post by Walt Decker on Nov 11, 2021 15:29:07 GMT -5
I think I have it worked out. When you have problems, let me know. Included in the zip:
TABCTL_000._BAS TAB_CONTROL.txt TABCTL.DLL
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 11, 2021 16:25:05 GMT -5
Thanks Walt!! Much appreciated. I am going to give it a go... Regards Dennis
|
|
|
Post by metro on Nov 11, 2021 16:47:24 GMT -5
Glad it is working for you. As far as I know you are the only person using it and really running it through the paces. I do appreciate it. +1,
I came out of retirement to earn a couple of dollars, landed a job as a bookkeeper , noticed that there were dozens of requests for
customer details or job details. So instead of (actually as well as ) 10,000 manila files in cabinets.
All job sheets are scanned so I can do a quick search for job addresses or contract numbers and display a PDF. I can now easily search for any customer detail or a quick search for Post Codes. Thanks Walt, amazing what I can pack into a small piece of screen real estate. this sits in the top right hand corner of my screen all day.....
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 12, 2021 1:23:02 GMT -5
Walts's TAB control is a valuable addition to the LB programmer's toolbox !!!
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 12, 2021 2:47:07 GMT -5
Hi Walt The font tool works well - tried all the options; italic, underline, etc. I have a feeling that the Bold option does not work but I could be wrong. I set it on and off and could detect no change - just check it. The font setting for the rest of the TAB window is as follows:
print #PTB1, "font ms_sans_serif 10 Bold"
I set the following up to mimic the above settings for the Tab Titles.
FntName$ = "ms_sans_serif" '<--- YOUR FONT NAME
CALLDLL #TAB, "FN_SetTabFont",_
TabHndl AS ULONG, _ ' <--- handle of tab
FntName$ AS PTR, _ ' <--- font name
10 AS LONG, _ '<--- point size
1 AS LONG, _ '<--- bold
0 AS LONG, _ '<--- italic
0 AS LONG, _ '<--- underline
0 AS LONG, _ '<--- strike out
FontHndl AS ULONG '<--- RETURN: font handle or zero
Otherwise all great!! Thanks... Dennis
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 12, 2021 4:01:17 GMT -5
OK, some further testing revealed a strange issue.
When the program is run in the IDE, it works perfectly.
When it is compiled to a .tkn file, it executes the control perfectly but behaves strangely when closing the parent and tab files.
What happens when you close the files, the program seems to do some processing and then abruptly ends.
I put in some diagnostic messages and saw that it had difficulty closing the tab control window.
I changed the sequence of close so that the tab control window is closed first followed by the two tab child windows
The program demonstrated the same strange behaviour although it did get further but went funny when attempting to close the parent window.
No error message is given - it just does some thinking and closes abruptly.
I switched "on error" on but no error was detected by LB.
Went back to the IDE and ran it in there and all works perfectly.
What I then did was to change the sequence of closing. Closed the Parent window first, followed by the two tab child windows and then finally the tab control window.
That worked in both environments IDE and .TKN!!
Glad to have found the problem but it does mean that the windows must be closed in a certain sequence. So the only outstanding issue that I still have is perhaps with the bold option raised in my earlier post.
Kind regards
Dennis
|
|
|
Post by Walt Decker on Nov 12, 2021 8:56:15 GMT -5
Dennis: Font issue: Did you check the value of FontHndl? I will bet the value is zero. There is no "ms_sans_serif" font. The font name is Ms Sans Serif. The name has to mirror that displayed by a font dialog or an enumfonts() routine.
EDIT:
Just looked at the MS CreateFont() API. You will get a handle provided the function can find a font that matches your criteria otherwise the return will be zero. So, the font handle you receive is not for the Ms Sans Serif font, but something that matches 10 point, bold.
I will take a look at the closing routine. Might take a bit to find the problem. I probably missed something when I added the font tool.
Would you like to put some color on your forms and controls?
Metro: That is impressive! You did a wonderful design job. Thanks for using my tab control
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 12, 2021 12:39:21 GMT -5
Hi Walt Changed the font to Ms Sans Serif and the non-bolding issue persists. FontHndl returns a value much greater than zero. "ms_sans_serif 10 bold" works for the overall window. The following is used to set that and as you can see from the attached screenshot, it works for the overall window. OPEN "Cost options" FOR WINDOW AS #PTB1 print #PTB1, "font ms_sans_serif 10 Bold" And this is what I used for the DLL: FntName$ = "Ms Sans Serif" '<--- YOUR FONT NAME CALLDLL #TAB, "FN_SetTabFont",_ TabHndl AS ULONG, _ '<--- handle of tab FntName$ AS PTR, _ '<--- font name 10 AS LONG, _ '<--- point size 1 AS LONG, _ '<--- bold 0 AS LONG, _ '<--- italic 0 AS LONG, _ '<--- underline 0 AS LONG, _ '<--- strike out FontHndl AS ULONG '<--- RETURN: font handle or zero print FontHndl The result is what you see on the attached screenshot. Not really interested in color at the moment but might consider one the entire system is up and running.... Sorry to be such a nuisance but I think the control is going to be handy to many others besides me and Metro Attachments:Doc4.docx (172.91 KB)
|
|
|
Post by Walt Decker on Nov 12, 2021 13:03:21 GMT -5
Ok. I will check it out as soon as I trace down the crash problem. It seemed to work well with Hobo Std, Times New Roman, and Courier New.
You are not a nuisance, Dennis. This is the most feed-back I have received concerning any of the tools I have written. I appreciate it.
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 13, 2021 6:23:50 GMT -5
Hi Walt Tried changing the fonts but still no "boldness". The font does change however and all the other attributes work except "bold". I must be doing something wrong. A non-zero result is always returned. I am going to try to see what happens in the original demo program. I also tried setting the font after applying changes to the window format. Here is the font change part of the code.
' FntName$ = "Ms Sans Serif" '<--- YOUR FONT NAME ' FntName$ = "Hobo Std" '<--- YOUR FONT NAME ' FntName$ = "Times New Roman" '<--- YOUR FONT NAME FntName$ = "Courier New" '<--- YOUR FONT NAME
CALLDLL #TAB, "FN_SetTabFont",_ TabHndl AS ULONG, _ '<--- handle of tab FntName$ AS PTR, _ '<--- font name 10 AS LONG, _ '<--- point size 1 AS LONG, _ '<--- bold 0 AS LONG, _ '<--- italic 0 AS LONG, _ '<--- underline 0 AS LONG, _ '<--- strike out FontHndl AS ULONG '<--- RETURN: font handle or zero
|
|