|
Post by George on Oct 4, 2022 9:15:02 GMT -5
Right now, there's a simple routine that examines the DPI of the system's desktop, and adjusts all the default font sizes of all the non-edit-data fonts(SB, Tab headers etc.) accordingly based on the old 'normal' of 96 DPI. It's not perfect, but is better than nothing.
SUB FontAdjustSizes() '----- Adjust fonts if high DPI used LOCAL hDC, LPIy, factor AS LONG hDC = GetDC(%HWND_DESKTOP) ' Get Desktop handle LPIy = GetDeviceCaps(hDC, %LOGPIXELSY) ' Get pixels / inch vertically ReleaseDC %HWND_DESKTOP, hDC ' Free hDC factor = (LPiY/96) * 100 ' Calc % font size gFontScale = factor / 100 ' Create a factor out of it '--------------------------------------------------------------+ ' Recreate the Fonts | '--------------------------------------------------------------+ FONT NEW "Arial", 10 / gFontScale, 1, 1, 1 TO gBoldFont ' Build font for our Preferences Dialog FONT NEW "Courier New", 10 / gFontScale, 1, 1, 1 TO gFixedFont ' Build font for our Preferences Dialog FONT NEW "Tahoma", 10 / gFontScale, 0, 1, 1 TO gSBFont ' Build font for the Status Bar FONT NEW "Tahoma", 10 / gFontScale, 1, 1, 1 TO gSBFontB ' Build font for the Status Bar FONT NEW "Tahoma", 12 / gFontScale, 0, 1, 1 TO gHlpFont ' Build font for the Help Dialog FONT NEW "Tahoma", 12 / gFontScale, 1, 1, 1 TO gHlpFontB ' Build font for the Help Dialog END SUB
|
|
|
Post by George on Oct 3, 2022 14:40:54 GMT -5
The box sizes of the SB are specified in pixels by absolute numbers from left to right.
The display routine for SB data uses the same font for everything. The problem is that there is no API to return a font given a string of text and a dialog size. It works the other way, you point the API at a dialog control, which has a font assigned, and it returns how much space it will take. So it's an iterative loop to find the optimum font size.
And if could be done at display time, you'd end up with different font sizes in the same box depending on the actual text data. And every box would have different font sizes. It would be a visual mess.
Picture the difference between "BNDS: MAX" and "BNDS: 350 to 1500" where 1 is twice the width of the other. If the text was small enough, it would even pick a huge font and blow the vertical dimensions of the box. It's simply not easy.
As I said, non-trivial.
George
|
|
|
Post by George on Oct 3, 2022 12:53:54 GMT -5
Robert: The main problem is a choice made back when SPFLite migrated from a Command line text syle window, to a proper Windows dialog. PB provides two unit types to dimension dialogs and their controls - Pixels and Dialog units, I chose Pixels as everything I was migrating was previously in Pixels.
As you're finding out Pixels, and hi-res displays don't get along, there is no simple easy rescaling available. SPFLite does some minor attempt, but it's not enough.
George
|
|
|
Post by George on Oct 3, 2022 8:31:14 GMT -5
Robrt: Certainly possible, but tricky as the sizes of the boxes would have to be calculated based on the longest string directed to that box in the chosen font. The custom layout etc. of the SB is already a bit convoluted. But this IS an area where something needs to be done.
George
|
|
|
Post by George on Oct 2, 2022 10:12:38 GMT -5
Srefan: One of those Hmmmmm. I think it may be in the logic that initially creates an FTX entry in the CFG file. My FTX works fine, but that may be because I changed something after my initial FTX entry was created to muck things up.
I guess you'll have to wait a bit longer to try it out.
George
|
|
|
Post by George on Sept 28, 2022 13:31:28 GMT -5
Stefan: Yes, they're 'ghosts'. In-process line commands are tracked in a table as they're entered. This is to avoid scanning a huge file for pending commands (think million+ lines).
As lines are inserted/deleted, this table and it's reference LPtr values has to be adjusted for these inserted/deleted lines (along with a bunch of other internal similar tables). Somewhere this adjustment for the B& style is fouled up.
I'm going to have to carefully 'walk' through the CC/B& and MM/B& variations and see if I can spot why one works and the other doeasn't. Plain old slog-work.
George
|
|
|
Post by George on Sept 28, 2022 9:01:05 GMT -5
Dave: Check the XTABS setting, better be 0. Otherwise any X'09' TAB character will get expanded and muck things up.
George
|
|
|
Post by George on Sept 27, 2022 8:31:14 GMT -5
Odd. I'll have a look.
George
[UPDATE]
I hate to say this, but if this gets fixed (ever) it will take a long time. It is buried very deeply in the whole line command handling jungle, I'm not sure anymore how it all works. I've spent a few hours now in debug, and basically gotten nowhere. LCmd handling goes through many iterations through routines as it winnows down to what's actually needed to be done, this makes adding breakpoints ridiculous as they get hit over and over during these loops and it's easy to lose track of what level of calling you're at.
I wish I had never been talked into adding the & support, line comands were bad enough before them.
It works fine with CC instead of MM. It works fine with A& instead of B& (Probably because the insertion point is before the B& line, but this is true for CC as well.
For now use A&. If I feel brave I might try again, but this is at the bottom of my list. I'm really concerned any fix may just open up other weird oddities in line control handling.
Maybe I'm just getting too old to wrap my mind around all this anymore.
[/UPDATE]
|
|
|
Post by George on Sept 26, 2022 13:21:34 GMT -5
This is now complete. Painful because of the quantity, not the complexity.
George
|
|
|
Post by George on Sept 26, 2022 13:20:02 GMT -5
OK, I think we have it properly fixed.
George
|
|
|
Post by George on Sept 25, 2022 11:04:11 GMT -5
Robert: Yes, famous last words. It's going to mean going through each macro and tweaking it. A pain since in many of them here's a FUNCTION = xxxxxx to set the result (where xxxx may be an internal function call). And you can't pass FUNCTION as a parameter to the TRACE code (Haven't tried it, but pretty sure it will fail).
We'll see.
George
|
|
|
Post by George on Sept 25, 2022 10:51:06 GMT -5
Guys: Basically simple, but a real pain to locate where and what to change without mucking up the non-relevant code. It is certainly a delicate piece of work. Hopefully now corrected. At least it handles the error samples you provided. George
[Update] Further testing shows this to be just a bit more involved. The fix I put in affects the overall general RFIND repositioning. The problem was not just an adjustment of +1 somewhere as we all thought.
Example: Lets call the methods Old and New, underlines are the 'found' string
Data: xxx xxx
Cmd: F xx and following RFINDS
Old: xxx xxx
xxx xxx
xxx xxx
xxx xxx
New: xxx xxx xxx xxx
Using command F xx ALL
Old: xxx xxx New: xxx xxx
We just can't change FIND like that, I'll have to re-do the fix.
[/UPDATE]
|
|
|
Post by George on Sept 25, 2022 9:35:51 GMT -5
OK PRESERVE C is now corrected.
George
|
|
|
Post by George on Sept 24, 2022 14:17:28 GMT -5
Robert: I downloaded the Working With Doc, got to page 4 (of 11) and my head hurts, and my eyes are drooping.
If this is in any way destined for the user documentation, it's overwhelming. If it's for me, it's only 'just a bit much'.
You're very thorough, but If I were a user, and explored this, I'd close the cover and go back to normal work. Maybe you understand syntax diagrams like this but I sure don't, it's gibberish to me (considering I DO understand what it's trying to impart)
I think you're too much into the detailed "SPECS", that the coder needs to know. And since that's you, I don't need to know anything other that what other SPFLite changes you want to go with it.
What I'd like to see is what the "Working with ..." looks like for the final Help file. Hopefully it's short and succinct.
I'll try and work through the remaining pages and try and figure out just what it is you expect of me.
[UPDATE] Just hit your Fwd/Bkwd labels description. Can't tell you how much I hate it. Bkwd is simply NOT NEEDED.
[/UPDATE]
[UPDATE2] Ditto for those unlabelled wild cards, you're killing this with complexity.
[/UPDATE2]
[UPDATE3] SORT routine WILL NOT be updated for SORT EFT. Period.
[/UPDATE3]
George
|
|
|
Post by George on Sept 24, 2022 13:36:58 GMT -5
Robert: I've never had a problem with your latest EFT stuff, finish it off and I'll replace the current one, change everything to EFT (from FTX) and get a Beta out you can play with.
As to your Session/LOGON idea, well that was simply way too big a change. Redesigning things to accommodate your ideas was simply a 'bridge too far'. Startup and Instance management as it is, is non-trivial, what you were asking for would frankly be too much for me.
Please don't lump one 'forget it' into a blanket shutdown.
George
|
|