From: Amilcar A. Camargo on 29 Sep 2009 15:43 On Tue, 29 Sep 2009 21:24:37 +0200, Karl Faller <k.faller_withoutthat_(a)onlinehome.de> wrote: >Amilcar, >>How many controls are in the dialog? The ellipsis should show when you step out >>from the control (or when it does not have focus). When it has focus, it >>behaves normally. ><Argh> - that was it - lazy as i am i had put only the one sle onto >the dlg and neglected to try to understand what i read in the code ;-) >Added some buttons, and now is all fine. Glad it worked. The idea is that you can edit the control normally and, when going out, you can see and understand, at least, your filename... Best regards, Amilcar A. Camargo F. Guatemala, C. A.
From: Urs Eggmann on 30 Sep 2009 14:25 Hi Amilcar, Thank you for sharing your code with us. Regards Urs "Amilcar A. Camargo" <amilcarcamargo(a)gmail.com> schrieb im Newsbeitrag news:4po4c5td3stf8fbb191uoouu4og2msv6cs(a)4ax.com... > On Tue, 29 Sep 2009 21:24:37 +0200, Karl Faller > <k.faller_withoutthat_(a)onlinehome.de> wrote: > >>Amilcar, >>>How many controls are in the dialog? The ellipsis should show when you >>>step out >>>from the control (or when it does not have focus). When it has focus, it >>>behaves normally. >><Argh> - that was it - lazy as i am i had put only the one sle onto >>the dlg and neglected to try to understand what i read in the code ;-) >>Added some buttons, and now is all fine. > > Glad it worked. The idea is that you can edit the control normally and, > when > going out, you can see and understand, at least, your filename... > > Best regards, > Amilcar A. Camargo F. > Guatemala, C. A.
From: BatiVenci on 3 Oct 2009 16:27 Thanks a lot, Amilcar. That was just my idea, when I started that thread. Now, I will update my code with Your work. BatiVenci, Varna, Bulgaria
From: Amilcar A. Camargo on 4 Oct 2009 11:52 On Sat, 3 Oct 2009 13:27:50 -0700 (PDT), BatiVenci <BatiVenci(a)Yahoo.com> wrote: >Thanks a lot, Amilcar. > >That was just my idea, when I started that thread. >Now, I will update my code with Your work. Glad it helps Regards, Amilcar A. Camargo F. Guatemala, C. A.
From: Phil Mermod on 5 Oct 2009 05:59 Hi Amilcar, Thanks for sharing your code. I have the following behavior using Windows Vista Pro Sp2 with Windows Vista theme (Aero mode) : I enter the path in the sle then press Tab : in the end of the sle, there is still a part of the text selected (blue) !?!? If I move the cursor upon the sle, it disappears.... Check the screenshot here :http://www.pkl.ch/dev/screenshots/slepath.jpg (The screenshot was taken just after press Tab) Anyone has the same issue ? Cheers, -- Phil Mermod Crystal Reports Library for Visual Objects http://www.pkl.ch/dev/ Amilcar A. Camargo wrote: > Hi Everybody, > > Some weeks ago there was a thread about using PathCompactPath > to show 'compacted' paths in SLE. Today i share with all of > you my class that allows to edit the full text but, once > entered, shows it in a 'compacted' way so the user can > understand what's inside. > > [BEGIN PASTE] > > CLASS SlePath INHERIT SingleLineEdit > // shows 'compacted' paths > // > // Author.......: Amilcar Camargo > // Date.........: 15-Jul-2007 > > METHOD Dispatch( oEv ) CLASS SIAAPSlePath > // Event handler, overrides where necessary > // > LOCAL uMsg := oEv:Message AS LONG > LOCAL wParam := oEv:wParam AS DWORD > LOCAL lParam := oEv:lParam AS LONG > > DO CASE > CASE uMsg == WM_PAINT > IF GetFocus() <> SELF:Handle() > SELF:ExposeEx( oEv ) > RETURN 0L > ENDIF > > CASE uMsg == WM_ERASEBKGND > IF SELF:PaintBackground( PTR( _CAST, wParam ) ) > SELF:EventReturnValue := 1L > RETURN 1L > ENDIF > > ENDCASE > > RETURN SUPER:Dispatch( oEv ) > > METHOD ExposeEx( uEvent ) CLASS SIAAPSlePath > // Paints out compacted path > // > LOCAL sPStru IS _winPAINTSTRUCT > LOCAL hDC AS PTR > LOCAL hWnd AS PTR > LOCAL iLen AS LONG > LOCAL iSaveDC AS INT > LOCAL pText AS PTR > LOCAL hFont AS PTR > LOCAL dwColor AS DWORD > LOCAL sRect IS _winRECT > > hWnd := SELF:Handle() > > // Check if there is a need to repaint > IF GetUpdateRect( hWnd, NULL_PTR, FALSE ) > > hDC := BeginPaint( hWnd, @sPStru ) > IF hDC <> NULL_PTR > > // save dc status > iSaveDC := SaveDC( hWnd ) > > // our area > GetClientRect( hWnd, @sRect ) > > // Erase background > IF sPStru.fErase > SendMessage( hWnd, WM_ERASEBKGND, DWORD( _CAST,hDC ), 0L ) > ENDIF > > // Is there something to display > iLen := SendMessage( hWnd, WM_GETTEXTLENGTH, 0, 0L ) > IF iLen > 0 > pText := MemAlloc( MAX_PATH ) > IF pText <> NULL_PTR > // Get foreground color > IF SELF:TextColor <> NULL_OBJECT > dwColor := SELF:TextColor:ColorRef > ELSE > dwColor := GetSysColor( COLOR_WINDOWTEXT ) > ENDIF > > // Get text font > // Use <oFont> to avoid creating a default font > IF SELF:oFont <> NULL_OBJECT > hFont := SELF:oFont:Handle() > ELSE > hFont := GetStockObject( DEFAULT_GUI_FONT ) > ENDIF > > MemClear( pText, MAX_PATH ) > SendMessage( hWnd, ; > WM_GETTEXT, ; > MAX_PATH, ; > LONG(_CAST, ; > pText ) ) > SetTextColor( hDC, dwColor ) > SelectObject( hDC, hFont ) > PathCompactPath( hDC, pText, sRect.right - sRect.left - 2 > ) TextOut( hDC, 0, 1, pText, LONG( _CAST, PszLen( pText ) > ) ) MemFree( pText ) > ENDIF > ENDIF > > // Restore DC > RestoreDC( hWnd, iSaveDC ) > > ENDIF > > // close painting cicle > EndPaint( hWnd, @sPStru ) > SELF:EventReturnValue := 1L > ENDIF > > RETURN NIL > > METHOD PaintBackground( uDC ) CLASS SIAAPSlePath > // Background erase > // > LOCAL lRet AS LOGIC > LOCAL hDC AS PTR > LOCAL sRect IS _winRECT > LOCAL hBrush AS PTR > > lRet := TRUE > hDC := uDC > GetClientRect( SELF:Handle(), @sRect ) > > IF SELF:oControlBackground <> NULL_OBJECT > hBrush := SELF:oControlBackground:Handle() > ELSE > hBrush := PTR( _CAST, COLOR_WINDOW + 1 ) > ENDIF > FillRect( hDC, @sRect, hBrush ) > > RETURN lRet > > > [END PASTE] > > Hope this is of help to somebody. > > Best regards, > Amilcar A. Camargo F. > Guatemala, C. A.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: ODBC drivers Next: Visual Objects 2.8 Service Pack 3 released today Sept. 30, 2009 |