Jump to content

jcbrief

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by jcbrief

  1. M23, Sorry I've been gone. I have health issues and have little resources for much else. I'll get back to you when I can. Joe
  2. Can't wait to see it . Thanks. Joe
  3. M23 I have been thinking on the tabs "ExtMsgBox" and "StringSize". Sorry I do things slowly. My comment is I do things at sub-turtle speeds, while others do things at warp speed. I'm wondering if you have the Tab Expansion inside ExtMsgBox on the string for Label that is passed to it. That way your StringSize will see the full line and use its wrap functions correctly, and return the correct box size even if strings are wrapped. Joe
  4. M23 RE: "Tab Expansion implementation", It seems to take care of the window size problems. With what I'm doing it seems to work fine. I looked into your "_StringSize()" and saw how you took care of it. I noticed how you change tabs to " XXXXXXXX", then restore tabs later. I tried to figure out how to use a tab conversion, and got lost in being able to wrap lines with that expansion. Thanks, Joe
  5. M23 I'm now looking at the changes you have made to _StringSize(), I should have looked there before asking. I see you have made many changes there. I do things slowly, and I see I will have to take my time looking at _StringSize() new vs old. I didn't get into it before, just used it. I have learned so much by getting into your code . Thanks, Joe
  6. M23 Re 72, found it. Thanks, OBTW looking at your change to EMB I saw you set the font attribute to 1 when tabs option is uses. What is font attribute 1??. I've looked around a bit for it, but w/o luck. Font attributes 2+ (bit mapped) yes, but not 1. Thanks, Joe
  7. M23 Re: $aDefFontData[0] = Int(2 * (.25 - DllStructGetData($tFont, 1) * 72 / $iPixel_Y)) / 2 I will try it. thanks. Its not that I prefer 8.5 vs 8.3, but I an playing with a modification of your EMB that also has CheckBoxes and RadioButtons. I noticed the difference in the default font size and tracked it to this size difference. I will search online for this. I was more wondering where the 72 came from. Again I like to understand things. My display uses 96 DPI, so not that. Oh, well will look. Thanks, Joe
  8. First I want to apologize for not getting back to you earlier. Since my post was on the bottom of a page I never saw anything after it (duh new page, sigh). I've been checking for days and didn't see your reply. sorry. I will be trying what you have said. I was mainly wanting to let you know things I had found. I knew Tabs could be a problem with non-fixed size fonts, but couldn't figure out an approach to it. I've been using your EMB and have really appreciate all the work you have put into it. It has saved me lots of time in one of the projects I'm working on. If you don't mind helping me understand some things. I have some questions re: what I've seen in your code. I've noticed for my system: (WinXP Window size 1024/768) that the default font is iDef_EMB_Font_Size=[8.3] sDef_EMB_Font_Name=[Tahoma]. Having a size of 8.3 seems a bit odd. Could you point me in a direction to explain how your Func _GetDefaultEMBFont() works ?. More specifically If Not @error Then $iPixel_Y = $iPixel_Y[0] ; Calculate point size $aDefFontData[0] = -Round(((1 * DllStructGetData($tFont, 1)) * 72 / $iPixel_Y), 1) EndIf From playing around the default font size seems to be 8.5. At least when I have my code using 8.3 it will come out as 8. But 8.5 will look the same as in yours. I'm not trying to be picky, just trying to understand this. I notice this in your your "ExtMsgBox Example", "Test 2", "Default Font" Button. Thank, Joe
  9. Nice UDF. I've only just noticed your UDF and haven't started using it yet. But I wanted to let you know what I've found. I will start using your "ExMsgBox.au3" it in my code and expect it to be very useful. Something I've run into with trying to use Tab Characters in strings. I've seen that StringSize doesn't report line lengths correctly on the following: If the line with the Tab shows longer (not same as length of its string) then the other lines w/o tabs the msgbox doesn't display all the text. I figure StringLen correctly reports the length of the the string and just counts the Tab Character as one Charater. but not the length with the Tabs expanded. Now I have to admit this is just a guess, but by playing with my own MsgBox I found that in the line with Tab Characters I expanded the Tab Character to spaces before calling the StringLen everything looked fine. To show you what I mean I've added the following to your "ExtMsgBox Example.au3" in the "Test 2" section before the first tab string: $sMsg &= @TAB & @TAB & "A line long enough not to scroll" & @CRLF which then looks like: Case $hButton2 ; Hide the main GUI to centre the message box on screen GUISetState(@SW_HIDE, $hTest_GUI) ; Change font and justification, leaving colours unchanged _ExtMsgBoxSet(5, $SS_LEFT, -1, -1, 12, "Arial") $sMsg = "As 'EMB Test' is hidden, this is centred on screen" & @CRLF & @CRLF $sMsg &= "It has:" & @CRLF $sMsg &= @TAB & @TAB & "A line long enough not to scroll" & @CRLF $sMsg &= @TAB & "An Info icon," & @CRLF $sMsg &= @TAB & "1 offset button" & @CRLF $sMsg &= @TAB & "Left justified text," & @CRLF $sMsg &= @TAB & "Default button text," & @CRLF $sMsg &= @TAB & "No Taskbar button and " & @CRLF $sMsg &= @TAB & "TOPMOST set" & @CRLF& @CRLF $sMsg &= "The width is set by the maximum line length" & @CRLF & @CRLF $sMsg &= "(which is less than max message box width)" & @CRLF & @CRLF $sMsg &= "It will time out in 20 seconds" ; Use $MB_ constants and set timeout value $iRetValue = _ExtMsgBox ($MB_ICONASTERISK, "Default Font", "Test 2", $sMsg, 20, $hTest_GUI) ConsoleWrite("Test 2 returned: " & $iRetValue & @CRLF) ; Reset to default _ExtMsgBoxSet(Default) ; Show the main GUI again GUISetState(@SW_SHOW, $hTest_GUI) WinSetOnTop($hTest_GUI, "", 1) WinSetOnTop($hTest_GUI, "", 0) When I click on "Test 2" On my computer (WinXP SP3) I don't see all the text in the msgbox. The only way I could get around this was with my own MsgBox (using your StringSize) and expanding the Tab character for each line. This is lifted out of my own "MyMsgBox.au3" Code (which can do very little compared to yours). I haven't tried it in yours yet. Func StringTabSpace($str) Local $i,$s,$chr Local $ai,$array Local $len,$pos Local $f,$t $s = StringStripCR($str) $array = StringSplit($s,@LF) For $ai = 1 to $array[0] $s = "" $len = StringLen($array[$ai]) $pos = 1 For $i = 1 to $len $chr = StringLeft($array[$ai],1) $array[$ai] = StringTrimLeft($array[$ai],1) If $chr = @TAB Then For $f = Mod($pos,8) to 8 ; ConsoleWrite("f=["&$f&"]" & @CRLF) $s &= " " $pos += 1 Next Else $s &= $chr $pos += 1 EndIf Next $array[$ai] = $s Next ; _ArrayDisplay($array,"array") $s = "" For $ai = 1 to $array[0] $s &= $array[$ai] & @LF Next $s = StringTrimRight($s,1) Return $s EndFunc I can already see that this works fine with my simple left justified MsgBox's, but not sure how to implement it with all the formats yours can handle. Thanks for all your hard work, Joe
×
×
  • Create New...