topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Combometro | Dear Mr. Rao,
I can't find out without changing the source code how to do this.
I mean to enter a new text which is not inside the list.
Best regards,
Otto |
Combometro | Hello Antonio,
Is there another solution without changing the source of combom.prg?
Best regards,
Otto
[quote:37wtwd6n]
I can't find out without changing the source code how to do this.
I mean to enter a new text which is not inside the list.
[/quote:37wtwd6n] |
Combometro | Any news?
Best regards,
Otto |
Combometro | Hello Antonio,
does Fivewin provide in near future this features?
Thanks in advance
Otto |
Combometro | Hello Antonio,
do you think you can provide this Feature soon?
Please let me know. Otherwise I search for a workaround.
Best regards,
Otto |
Combometro | It seems that beside me no one is using ComboMetro.
For my purpose I made a workaround: I create a comboMetro a get and a button
With hide, enable, disable and some changes in source I have now the same behavior as comboBox drop down but with metro like style.
Best regards,
Otto |
Combos FWPPC 8.10 | Buenos días foro, tengo un problema con combos desde código incrustado en un dialogo. El único ejemplo que hay en samples es combos.prg pero faltaba el combos.ch, he cogido un combos.ch que tenía por ahi con esta estructura:[code:2asu04fg]
#define ID_SIMPLE 110
#define ID_DROPDOWN 120
#define ID_DROPDOWNLIST 130
#define ID_SELECTION 140
[/code:2asu04fg]suponiendo que esto está bien, cuando compilo el combos.prg, los elementos de los combos NO me aparecen aunque si los selecciono si cambian.Reitero si me podeis poner un ejemplo manejando combos en dialogos, pero NO desde recursos.Muchas Gracias a todos. |
Combos FWPPC 8.10 | Mike,Aqui tienes un ejemplo:[code:3r3xpzyq]
#include "FWCE.ch"
function Main()
local oDlg, cValue
DEFINE DIALOG oDlg TITLE "Combos" ;
SIZE 200, 100
@ 1, 1 COMBOBOX cValue ITEMS { "One", "Two", "Three" } OF oDlg
ACTIVATE DIALOG oDlg CENTERED
return nil
[/code:3r3xpzyq] |
Combos FWPPC 8.10 | Ups! <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> Me sale exactamente igual que en el ejemplo. Me pinta el combo se despliega pero está vacíoEstoy compilando con FWPPC 8.10, este es mi buildce.bat[code:1j8732yz]
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Pocket PC - October 2008 Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2008 for Microsoft Windows Pocket PC ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
ECHO Compiling...
IF "%FWDIR%" == "" set FWDIR="c:\software\fwppc810\fwppc"
set hdir=c:\software\fwppc810\harbour_ce
set hdirc=%hdir%\bin
set hdirl=%hdir%\lib
set fwppc=c:\software\fwppc810\fwppc
set vcdir=c:\software\fwppc810\vce
set include=%vcdir%\include\arm;%hdir%\include;%include%
set lib=%vcdir%\lib;%hdir%\lib;%lib%
set emulator_shared_folder=c:\pocketpc
%hdirc%\harbour %1 /n /i..\include;%hdir%\include /p %2 %3 > clip.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type clip.log
%vcdir%\bin\clarm -W3 -c /DARM /DUNICODE /I%hdir%\include /I%fwppc%\include %1.c
:ENDCOMPILE
IF EXIST %1.rc %vcdir%\bin\rc -r -d_CE %1
echo %1.obj > msvc.tmp
echo %fwppc%\lib\FiveCE.lib %fwppc%\lib\FiveCEC.lib >> msvc.tmp
echo %hdirl%\hbrtl.lib >> msvc.tmp
echo %hdirl%\hbvm.lib >> msvc.tmp
echo %hdirl%\gtgui.lib >> msvc.tmp
echo %hdirl%\hblang.lib >> msvc.tmp
echo %hdirl%\hbmacro.lib >> msvc.tmp
echo %hdirl%\hbrdd.lib >> msvc.tmp
echo %hdirl%\rddntx.lib >> msvc.tmp
echo %hdirl%\rddcdx.lib >> msvc.tmp
echo %hdirl%\rddfpt.lib >> msvc.tmp
echo %hdirl%\hbsix.lib >> msvc.tmp
echo %hdirl%\hbdebug.lib >> msvc.tmp
echo %hdirl%\hbcommon.lib >> msvc.tmp
echo %hdirl%\hbpp.lib >> msvc.tmp
echo %hdirl%\hbcpage.lib >> msvc.tmp
echo %hdirl%\hbw32.lib >> msvc.tmp
rem echo %hdirl%\tip.lib >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %vcdir%\lib\arm\coredll.lib >> msvc.tmp
echo %vcdir%\lib\arm\corelibc.lib >> msvc.tmp
echo %vcdir%\lib\arm\aygshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\ws2.lib >> msvc.tmp
echo %vcdir%\lib\arm\mfcce400.lib >> msvc.tmp
echo %vcdir%\lib\arm\ole32.lib >> msvc.tmp
echo %vcdir%\lib\arm\oleaut32.lib >> msvc.tmp
echo %vcdir%\lib\arm\olece400.lib >> msvc.tmp
echo %vcdir%\lib\arm\uuid.lib >> msvc.tmp
echo %vcdir%\lib\arm\ceshell.lib >> msvc.tmp
echo %vcdir%\lib\arm\commctrl.lib >> msvc.tmp
echo %vcdir%\lib\arm\wininet.lib >> msvc.tmp
IF EXIST %1.res echo %1.res >> msvc.tmp
%vcdir%\bin\link @msvc.tmp /nologo /SUBSYSTEM:WINDOWSCE,4.20 /MACHINE:ARM /ARMPADCODE:NO
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
copy %1.exe %emulator_shared_folder%
cecopy %1.exe dev:\samples
GOTO EXIT
ECHO
rem delete temporary files
@del %1.c
@del %1.obj
@del %1.ppo
@del msvc.tmp
:COMPILEERROR
@type clip.log
ECHO * Compile errors *
GOTO EXIT
:LINKERROR
ECHO * Linking errors *
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
[/code:1j8732yz]¿Que puede ser?Muchas Gracias |
Combos FWPPC 8.10 | Mike,Añade esta clase entera al final de mi ejemplo y vuelve a construirlo, graciascombobox.prg fwppc[code:rar4bpnn]
// FWPPC Class TComboBox (C) FiveTech Software 2005
#include "FiveWin.ch"
#include "Constant.ch"
#define GWL_STYLE -16
#define COMBO_BASE 0x140
#define CB_ADDSTRING ( COMBO_BASE + 3 )
#define CB_DELETESTRING ( COMBO_BASE + 4 )
#define CB_GETCURSEL ( COMBO_BASE + 7 )
#define CB_INSERTSTRING ( COMBO_BASE + 10 )
#define CB_RESETCONTENT ( COMBO_BASE + 11 )
#define CB_FINDSTRING ( COMBO_BASE + 12 )
#define CB_SETCURSEL ( COMBO_BASE + 14 )
#define CB_SHOWDROPDOWN ( COMBO_BASE + 15 )
#define CB_GETDROPPEDSTATE ( COMBO_BASE + 23 )
#define CB_ERR -1
#define CB_SETMINVISIBLE 5889 // 0x1701
#define CB_GETMINVISIBLE 5890 // 0x1702
#define SYS_COLOR_INDEX_FLAG 0x40000000
#define COLOR_WINDOW nOr( 5, SYS_COLOR_INDEX_FLAG )
#define COLOR_WINDOWTEXT nOr( 8, SYS_COLOR_INDEX_FLAG )
#define MB_ICONEXCLAMATION 48 // 0x0030
#define GW_CHILD 5
#define GW_HWNDNEXT 2
//----------------------------------------------------------------------------//
CLASS TComboBox FROM TControl
DATA aItems, aBitmaps
DATA lOwnerDraw, nBmpHeight, nBmpWidth
DATA nAt
DATA bDrawItem, bCloseUp
DATA cError AS String
DATA oGet
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId,;
bChange, bValid, nClrText, nClrBack, lPixel, oFont,;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, nStyle,;
cPict, bEChange ) CONSTRUCTOR
METHOD ReDefine( nId, bSetGet, aItems, oWnd, nHelpId, bValid, ;
bChange, nClrText, nClrBack, cMsg, lUpdate,;
bWhen, acBitmaps, bDrawItem, nStyle, cPict, bEChange ) CONSTRUCTOR
METHOD Add( cItem, nAt )
METHOD cToChar() INLINE Super:cToChar( "COMBOBOX" )
METHOD Change()
METHOD Close() INLINE ::SendMsg( CB_SHOWDROPDOWN, 0 )
METHOD CloseUp() INLINE If( ::bCloseUp != nil, Eval( ::bCloseUp, Self ),)
METHOD Default()
METHOD DefControl( oControl )
METHOD Del( nAt )
METHOD Destroy()
METHOD DrawItem( nIdCtl, nPStruct )
METHOD FillMeasure( nPInfo ) INLINE LbxMeasure( nPInfo, ::nBmpHeight )
METHOD FindString( cItem, nFrom ) INLINE ;
nFrom := If( nFrom == nil, 0, nFrom ),;
::SendMsg( CB_FINDSTRING, nFrom, cItem ) + 1
METHOD Find( cItem, nFrom ) INLINE ::FindString( cItem, nFrom ) != 0
METHOD GetDlgCode( nLastKey )
METHOD GetMinVisible() INLINE If( IsAppThemed(), ;
::SendMsg( CB_GETMINVISIBLE, 0, 0 ), 0 )
METHOD Initiate( hDlg )
METHOD Insert( cItem, nAt )
METHOD KeyChar( nKey, nFlags )
METHOD LostFocus()
METHOD lValid()
METHOD Modify( cItem, nAt )
METHOD MouseMove( nRow, nCol, nKeyFlags )
METHOD Open() INLINE ::SendMsg( CB_SHOWDROPDOWN, 1 )
METHOD Refresh() INLINE ::Set( Eval( ::bSetGet ) ), Super:Refresh()
METHOD Reset() INLINE Eval( ::bSetGet,;
If( ValType( Eval( ::bSetGet ) ) == "N", 0, "" ) ),;
::nAt := 0, ::SendMsg( CB_RESETCONTENT ),;
::Change()
METHOD Select( nItem ) INLINE ::nAt := nItem,;
::SendMsg( CB_SETCURSEL, Max( 0, nItem - 1 ), 0 )
METHOD Set( cNewItem )
METHOD SetBitmaps( acBitmaps )
METHOD SetItems( aItems ) INLINE ::Reset(), ::aItems := aItems,;
::Default(), ::Change()
// By default, 30 is the minimum number of visible items in XP Visual Themes
#ifndef __CLIPPER__
METHOD SetMinVisible( nItems ) INLINE ;
If( IsAppThemed(), ( ::SendMsg( CB_SETMINVISIBLE, nItems, 0 ) == 1 ), .f. )
#endif
METHOD ShowToolTip()
METHOD VarGet()
METHOD State() INLINE ::SendMsg( CB_GETDROPPEDSTATE, 0 )
METHOD IsClosed() INLINE ::State() == 0
METHOD IsOpen() INLINE ::State() == 1
METHOD LButtonDown() INLINE ::Open()
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId,;
bChange, bValid, nClrFore, nClrBack, lPixel, oFont,;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, nStyle,;
cPict, bEChange ) CLASS TComboBox
if nClrFore == nil
nClrBack := GetSysColor( COLOR_WINDOW )
endif
DEFAULT nRow := 0, nCol := 0, bSetGet := { || nil },;
oWnd := GetWndDefault(),;
oFont := oWnd:oFont,;
aItems := {}, nWidth := 40, nHeight := 60,;
nClrFore := GetSysColor( COLOR_WINDOWTEXT ),;
lPixel := .f., lUpdate := .f., lDesign := .f.,;
nStyle := CBS_DROPDOWNLIST
::cCaption = ""
::nTop = nRow * If( lPixel, 1, CMB_CHARPIX_H )
::nLeft = nCol * If( lPixel, 1, CMB_CHARPIX_W )
::nBottom = ::nTop + nHeight - 1
::nRight = ::nLeft + nWidth - 1
::nAt = 0
::aItems = aItems
::bChange = bChange
::bSetGet = bSetGet
::oWnd = oWnd
::oFont = oFont
if acBitmaps != nil
::SetBitmaps( acBitmaps )
else
::lOwnerDraw = .f.
endif
::nStyle = nOR( If( nStyle == CBS_DROPDOWN, 0, LBS_NOTIFY ), WS_TABSTOP,;
nStyle,;
LBS_DISABLENOSCROLL, WS_CHILD, WS_VISIBLE, WS_BORDER,;
WS_VSCROLL, If( lDesign, WS_CLIPSIBLINGS, 0 ),;
If( ::lOwnerDraw, CBS_OWNERDRAWFIXED, 0 ) )
::nId = ::GetNewId()
::nHelpId = nHelpId
::bValid = bValid
::lDrag = lDesign
::lCaptured = .f.
::cMsg = cMsg
::lUpdate = lUpdate
::bWhen = bWhen
::bDrawItem = bDrawItem
::SetColor( nClrFore, nClrBack )
if nStyle == CBS_DROPDOWN
::oGet := TGet():ReDefine( nil, ; // ID not used
::bSetGet, ; // bSETGET(uVar)
Self, ; // oDlg
::nHelpID, ; // Help Context ID
cPict, ; // Picture
nil, ; // Valid is handled by the CBx
::nClrText,;
::nClrPane,;
::oFont, ; // <oFont>
nil, ; // <oCursor>
cMsg, ; // cMsg
nil, ; // <.update.>
nil, ; // <{uWhen}>
bEChange, ; // {|nKey,nFlags,Self| <uEChange>}
.F. ) // <.readonly.> )
endif
if ! Empty( oWnd:hWnd )
::Create( "COMBOBOX" )
::nHeight = nHeight
::nWidth = nWidth
::Default()
if oFont != nil
::SetFont( oFont )
endif
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
endif
if ::oGet != nil
::oGet:hWnd = GetWindow( ::hWnd, GW_CHILD )
::oGet:Link()
::oGet:bLostFocus = ;
{| hCtlFocus, nAt, cItem| cItem := GetWindowText( ::hWnd ), ;
nAt := ::SendMsg( CB_FINDSTRING, 0, Trim( cItem )) + 1,;
Eval( ::bSetGet, cItem ),;
::Select( nAt ),;
SetWindowText( ::hWnd, cItem ),;
If( ::bValid != nil .and. ;
GetParent( hCtlFocus ) == GetParent( ::hWnd ),;
If( ! Eval( ::bValid ),;
PostMessage( ::hWnd, WM_SETFOCUS ),),) }
endif
if lDesign
::CheckDots()
endif
return Self
//----------------------------------------------------------------------------//
METHOD ReDefine( nId, bSetGet, aItems, oWnd, nHelpId, bValid, ;
bChange, nClrFore, nClrBack, cMsg, lUpdate, ;
bWhen, acBitmaps, bDrawItem, nStyle, cPict, ;
bEChange ) CLASS TComboBox
if nClrFore == nil
nClrBack := GetSysColor( COLOR_WINDOW )
endif
DEFAULT aItems := {},;
nClrFore := GetSysColor( COLOR_WINDOWTEXT ),;
lUpdate := .f., ;
nStyle := CBS_DROPDOWNLIST
::nId = nId
::hWnd = 0
::aItems = aItems
::bChange = bChange
::bSetGet = bSetGet
::oWnd = oWnd
::nHelpId = nHelpId
::bValid = bValid
::nAt = 0
::lDrag = .f.
::lCaptured = .f.
::cMsg = cMsg
::lUpdate = lUpdate
::bWhen = bWhen
::bDrawItem = bDrawItem
::nStyle = nStyle
if acBitmaps != nil
::SetBitmaps( acBitmaps )
else
::lOwnerDraw = .f.
endif
::SetColor( nClrFore, nClrBack )
if nAnd( ::nStyle, CBS_DROPDOWNLIST ) == CBS_DROPDOWN
::oGet := TGet():ReDefine( nil, ; // ID not used
::bSetGet, ; // bSETGET(uVar)
Self, ; // oDlg
::nHelpID, ; // Help Context ID
cPict, ; // Picture
nil, ; // Valid is handled by the CBx
::nClrText,;
::nClrPane,;
::oFont, ; // <oFont>
nil, ; // <oCursor>
cMsg, ; // cMsg
nil, ; // <.update.>
nil, ; // <{uWhen}>
bEChange, ; // {|nKey,nFlags,Self| <uEChange>}
.F. ) // <.readonly.> )
endif
oWnd:DefControl( Self )
return Self
//----------------------------------------------------------------------------//
METHOD Add( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt == 0
AAdd( ::aItems, cItem )
else
ASize( ::aItems, Len( ::aItems ) + 1 )
AIns( ::aItems, nAt )
::aItems[ nAt ] = cItem
endif
::SendMsg( CB_ADDSTRING, nAt, FW_AnsiToWide( cItem ) )
return nil
//----------------------------------------------------------------------------//
METHOD Change() CLASS TComboBox
local cItem := GetWindowText( ::hWnd ) // Current Value
local nAt
nAt = ::SendMsg( CB_GETCURSEL ) + 1
if nAt == ::nAt .and. ! Empty( Eval( ::bSetGet ) )
return nil
endif
::nAt := nAt
if ::nAt != 0 .and. ::nAt <= Len( ::aItems )
if ValType( Eval( ::bSetGet ) ) == "N"
Eval( ::bSetGet, ::nAt )
else
Eval( ::bSetGet, ::aItems[ ::nAt ] )
endif
endif
if ::oGet != nil // Always not nil for dropdown
::oGet:VarPut( Eval( ::bSetGet ) ) // udate variable before calling bChange
::oGet:Refresh()
endif
if ::bChange != nil
Eval( ::bChange, Self, cItem )
endif
return nil
//----------------------------------------------------------------------------//
METHOD DefControl( oControl ) CLASS TComboBox
if ::aControls == nil
::aControls = {}
endif
AAdd( ::AControls, oControl )
return nil
//----------------------------------------------------------------------------//
METHOD Set( cNewItem ) CLASS TComboBox
local nAt
if ValType( cNewItem ) == "N"
nAt = cNewItem
if nAt == 0
nAt = 1
endif
else
nAt = AScan( ::aItems,;
{ | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cNewItem ) ) } )
endif
if ValType( cNewItem ) == "N" .or. nAt != 0
::Select( nAt )
Eval( ::bSetGet, cNewItem )
else
cNewItem := cValToChar( cNewItem )
Eval( ::bSetGet, cNewItem )
SetWindowText( ::hWnd , cNewItem )
endif
return nil
//----------------------------------------------------------------------------//
METHOD KeyChar( nKey, nFlags ) CLASS TComboBox
local lAccept
do case
case nKey == VK_TAB .or. nKey == VK_RETURN
if ::bChange != nil
lAccept = Eval( ::bChange, nKey, nFlags, Self )
if ValType( lAccept ) == "L" .and. lAccept
::oWnd:GoNextCtrl( ::hWnd )
endif
else
::oWnd:GoNextCtrl( ::hWnd )
endif
if nKey == VK_RETURN // Execute DEFPUSHBUTTON Action
Super:KeyChar( nKey, nFlags )
endif
return 0
otherwise
return Super:KeyChar( nKey, nFlags )
endcase
return nil
//----------------------------------------------------------------------------//
METHOD LostFocus() CLASS TComboBox
local nAt := ::SendMsg( CB_GETCURSEL )
Super:LostFocus()
if nAt != CB_ERR
::nAt = nAt + 1
if ValType( Eval( ::bSetGet ) ) == "N"
Eval( ::bSetGet, nAt + 1 )
else
Eval( ::bSetGet, ::aItems[ nAt + 1 ] )
endif
else
Eval( ::bSetGet, GetWindowText( ::hWnd ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Modify( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
::aItems[ nAt ] = cItem
::SendMsg( CB_DELETESTRING, nAt - 1 )
::SendMsg( CB_INSERTSTRING, nAt - 1, FW_AnsiToWide( cItem ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Insert( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
ASize( ::aItems, Len( ::aItems ) + 1 )
AIns( ::aItems, nAt )
::aItems[ nAt ] = cItem
::SendMsg( CB_INSERTSTRING, nAt - 1, FW_AnsiToWide( cItem ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Del( nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
ADel( ::aItems, nAt )
ASize( ::aItems, Len( ::aItems ) - 1 )
::SendMsg( CB_DELETESTRING, nAt - 1 )
endif
return nil
//----------------------------------------------------------------------------//
METHOD GetDlgCode( nLastKey ) CLASS TComboBox
if Len( ::oWnd:aControls ) == 1
return DLGC_WANTALLKEYS
endif
::oWnd:nLastKey = nLastKey
return DLGC_WANTALLKEYS
//----------------------------------------------------------------------------//
METHOD Initiate( hDlg ) CLASS TComboBox
Super:Initiate( hDlg )
::Default()
if ::oGet != nil
::oGet:hWnd = GetWindow( ::hWnd, GW_CHILD )
::oGet:Link()
::oGet:bLostFocus = ;
{| hCtlFocus, nAt, cItem| cItem := GetWindowText( ::hWnd ), ;
nAt := ::SendMsg( CB_FINDSTRING, 0, Trim( cItem )) + 1,;
Eval( ::bSetGet, cItem ),;
::Select( nAt ),;
SetWindowText( ::hWnd, cItem ),;
If( ::bValid != nil .and. ;
GetParent( hCtlFocus ) == GetParent( ::hWnd ),;
If( ! Eval( ::bValid ),;
PostMessage( ::hWnd, WM_SETFOCUS ),),) }
endif
::Refresh()
return nil
//----------------------------------------------------------------------------//
METHOD Default() CLASS TComboBox
local cStart := Eval( ::bSetGet )
if ! Empty( ::hWnd ) .and. ::nStyle == CBS_DROPDOWNLIST
::nStyle := GetWindowLong( ::hWnd, GWL_STYLE )
endif
if Empty( cStart )
Eval( ::bSetGet, If( Len( ::aItems ) > 0, ::aItems[ 1 ], "" ) )
cStart = If( Len( ::aItems ) > 0, ::aItems[ 1 ], "" )
endif
AEval( ::aItems, { | cItem, nAt | ::SendMsg( CB_ADDSTRING, nAt, FW_AnsiToWide( cItem ) ) } )
if ValType( cStart ) != "N"
::nAt = AScan( ::aItems, { | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cStart ) ) } )
else
::nAt = cStart
endif
::nAt = If( ::nAt > 0, ::nAt, 1 )
if cStart == nil
::Select( ::nAt )
else
::Set( cStart )
endif
return nil
//----------------------------------------------------------------------------//
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TComboBox
local nResult := Super:MouseMove( nRow, nCol, nKeyFlags )
return If( ::lDrag, nResult, nil ) // We want standard behavior !!!
//----------------------------------------------------------------------------//
METHOD SetBitmaps( acBitmaps ) CLASS TComboBox
local n
::lOwnerDraw = .t.
if acBitmaps != nil
::aBitmaps = Array( Len( acBitmaps ) )
for n = 1 to Len( acBitmaps )
if File( acBitmaps[ n ] )
::aBitmaps[ n ] = ReadBitmap( 0, acBitmaps[ n ] )
else
::aBitmaps[ n ] = LoadBitmap( GetResources(), acBitmaps[ n ] )
endif
next
::nBmpHeight = nBmpHeight( ::aBitmaps[ 1 ] )
::nBmpWidth = nBmpWidth( ::aBitmaps[ 1 ] )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Destroy() CLASS TComboBox
local n
if ::aBitmaps != nil
for n = 1 to Len( ::aBitmaps )
DeleteObject( ::aBitmaps[ n ] )
next
endif
if ::oGet != nil
::oGet:End()
endif
return Super:Destroy()
//----------------------------------------------------------------------------//
METHOD DrawItem( nIdCtl, nPStruct ) CLASS TComboBox
return LbxDrawItem( nPStruct, ::aBitmaps, ::aItems, ::nBmpWidth, ::bDrawItem )
//----------------------------------------------------------------------------//
METHOD VarGet() CLASS TComboBox
local cRet, nAt := ::SendMsg( CB_GETCURSEL )
if nAt != CB_ERR
::nAt = nAt + 1
cRet := ::aItems[ nAt + 1 ]
else
cRet := GetWindowText( ::hWnd )
endif
return cRet
//----------------------------------------------------------------------------//
METHOD lValid() CLASS TComboBox
local lRet := .t.
if ValType( ::bValid ) == "B"
lRet = Eval( ::bValid, ::oGet )
endif
return lRet
//----------------------------------------------------------------------------//
METHOD ShowToolTip() CLASS TComboBox
local nOldBottom
nOldBottom = ::nBottom
::nBottom = ::nTop + GetTextHeight( ::hWnd ) + 8
Super:ShowToolTip()
::nBottom = nOldBottom
return nil
//----------------------------------------------------------------------------//
static function IsAppThemed()
return .f.
//----------------------------------------------------------------------------//
[/code:rar4bpnn] |
Combos FWPPC 8.10 | Buenas Tardes Antonio, Lo he incluido y al final lo he dejado asi:[code:28a7nwsu]
#include "FWCE.ch"
#include "FiveWin.ch"
#include "Constant.ch"
#define GWL_STYLE -16
#define COMBO_BASE 0x140
#define CB_ADDSTRING ( COMBO_BASE + 3 )
#define CB_DELETESTRING ( COMBO_BASE + 4 )
#define CB_GETCURSEL ( COMBO_BASE + 7 )
#define CB_INSERTSTRING ( COMBO_BASE + 10 )
#define CB_RESETCONTENT ( COMBO_BASE + 11 )
#define CB_FINDSTRING ( COMBO_BASE + 12 )
#define CB_SETCURSEL ( COMBO_BASE + 14 )
#define CB_SHOWDROPDOWN ( COMBO_BASE + 15 )
#define CB_GETDROPPEDSTATE ( COMBO_BASE + 23 )
#define CB_ERR -1
#define CB_SETMINVISIBLE 5889 // 0x1701
#define CB_GETMINVISIBLE 5890 // 0x1702
#define SYS_COLOR_INDEX_FLAG 0x40000000
#define COLOR_WINDOW nOr( 5, SYS_COLOR_INDEX_FLAG )
#define COLOR_WINDOWTEXT nOr( 8, SYS_COLOR_INDEX_FLAG )
#define MB_ICONEXCLAMATION 48 // 0x0030
#define GW_CHILD 5
#define GW_HWNDNEXT 2
//----------------------------------------------------------------------------//
function Main()
local oDlg, cValue :="One"
DEFINE DIALOG oDlg TITLE "Combos" SIZE 200, 100
@ 1, 1 COMBOBOX cValue ITEMS { "One", "Two", "Three" } OF oDlg
ACTIVATE DIALOG oDlg CENTERED
return nil
CLASS TComboBox FROM TControl
DATA aItems, aBitmaps
DATA lOwnerDraw, nBmpHeight, nBmpWidth
DATA nAt
DATA bDrawItem, bCloseUp
DATA cError AS String
DATA oGet
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId,;
bChange, bValid, nClrText, nClrBack, lPixel, oFont,;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, nStyle,;
cPict, bEChange ) CONSTRUCTOR
METHOD ReDefine( nId, bSetGet, aItems, oWnd, nHelpId, bValid, ;
bChange, nClrText, nClrBack, cMsg, lUpdate,;
bWhen, acBitmaps, bDrawItem, nStyle, cPict, bEChange ) CONSTRUCTOR
METHOD Add( cItem, nAt )
METHOD cToChar() INLINE Super:cToChar( "COMBOBOX" )
METHOD Change()
METHOD Close() INLINE ::SendMsg( CB_SHOWDROPDOWN, 0 )
METHOD CloseUp() INLINE If( ::bCloseUp != nil, Eval( ::bCloseUp, Self ),)
METHOD Default()
METHOD DefControl( oControl )
METHOD Del( nAt )
METHOD Destroy()
METHOD DrawItem( nIdCtl, nPStruct )
METHOD FillMeasure( nPInfo ) INLINE LbxMeasure( nPInfo, ::nBmpHeight )
METHOD FindString( cItem, nFrom ) INLINE ;
nFrom := If( nFrom == nil, 0, nFrom ),;
::SendMsg( CB_FINDSTRING, nFrom, cItem ) + 1
METHOD Find( cItem, nFrom ) INLINE ::FindString( cItem, nFrom ) != 0
METHOD GetDlgCode( nLastKey )
METHOD GetMinVisible() INLINE If( IsAppThemed(), ;
::SendMsg( CB_GETMINVISIBLE, 0, 0 ), 0 )
METHOD Initiate( hDlg )
METHOD Insert( cItem, nAt )
METHOD KeyChar( nKey, nFlags )
METHOD LostFocus()
METHOD lValid()
METHOD Modify( cItem, nAt )
METHOD MouseMove( nRow, nCol, nKeyFlags )
METHOD Open() INLINE ::SendMsg( CB_SHOWDROPDOWN, 1 )
METHOD Refresh() INLINE ::Set( Eval( ::bSetGet ) ), Super:Refresh()
METHOD Reset() INLINE Eval( ::bSetGet,;
If( ValType( Eval( ::bSetGet ) ) == "N", 0, "" ) ),;
::nAt := 0, ::SendMsg( CB_RESETCONTENT ),;
::Change()
METHOD Select( nItem ) INLINE ::nAt := nItem,;
::SendMsg( CB_SETCURSEL, Max( 0, nItem - 1 ), 0 )
METHOD Set( cNewItem )
METHOD SetBitmaps( acBitmaps )
METHOD SetItems( aItems ) INLINE ::Reset(), ::aItems := aItems,;
::Default(), ::Change()
// By default, 30 is the minimum number of visible items in XP Visual Themes
#ifndef __CLIPPER__
METHOD SetMinVisible( nItems ) INLINE ;
If( IsAppThemed(), ( ::SendMsg( CB_SETMINVISIBLE, nItems, 0 ) == 1 ), .f. )
#endif
METHOD ShowToolTip()
METHOD VarGet()
METHOD State() INLINE ::SendMsg( CB_GETDROPPEDSTATE, 0 )
METHOD IsClosed() INLINE ::State() == 0
METHOD IsOpen() INLINE ::State() == 1
METHOD LButtonDown() INLINE ::Open()
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId,;
bChange, bValid, nClrFore, nClrBack, lPixel, oFont,;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, nStyle,;
cPict, bEChange ) CLASS TComboBox
if nClrFore == nil
nClrBack := GetSysColor( COLOR_WINDOW )
endif
DEFAULT nRow := 0, nCol := 0, bSetGet := { || nil },;
oWnd := GetWndDefault(),;
oFont := oWnd:oFont,;
aItems := {}, nWidth := 40, nHeight := 60,;
nClrFore := GetSysColor( COLOR_WINDOWTEXT ),;
lPixel := .f., lUpdate := .f., lDesign := .f.,;
nStyle := CBS_DROPDOWNLIST
::cCaption = ""
::nTop = nRow * If( lPixel, 1, CMB_CHARPIX_H )
::nLeft = nCol * If( lPixel, 1, CMB_CHARPIX_W )
::nBottom = ::nTop + nHeight - 1
::nRight = ::nLeft + nWidth - 1
::nAt = 0
::aItems = aItems
::bChange = bChange
::bSetGet = bSetGet
::oWnd = oWnd
::oFont = oFont
if acBitmaps != nil
::SetBitmaps( acBitmaps )
else
::lOwnerDraw = .f.
endif
::nStyle = nOR( If( nStyle == CBS_DROPDOWN, 0, LBS_NOTIFY ), WS_TABSTOP,;
nStyle,;
LBS_DISABLENOSCROLL, WS_CHILD, WS_VISIBLE, WS_BORDER,;
WS_VSCROLL, If( lDesign, WS_CLIPSIBLINGS, 0 ),;
If( ::lOwnerDraw, CBS_OWNERDRAWFIXED, 0 ) )
::nId = ::GetNewId()
::nHelpId = nHelpId
::bValid = bValid
::lDrag = lDesign
::lCaptured = .f.
::cMsg = cMsg
::lUpdate = lUpdate
::bWhen = bWhen
::bDrawItem = bDrawItem
::SetColor( nClrFore, nClrBack )
if nStyle == CBS_DROPDOWN
::oGet := TGet():ReDefine( nil, ; // ID not used
::bSetGet, ; // bSETGET(uVar)
Self, ; // oDlg
::nHelpID, ; // Help Context ID
cPict, ; // Picture
nil, ; // Valid is handled by the CBx
::nClrText,;
::nClrPane,;
::oFont, ; // <oFont>
nil, ; // <oCursor>
cMsg, ; // cMsg
nil, ; // <.update.>
nil, ; // <{uWhen}>
bEChange, ; // {|nKey,nFlags,Self| <uEChange>}
.F. ) // <.readonly.> )
endif
if ! Empty( oWnd:hWnd )
::Create( "COMBOBOX" )
::nHeight = nHeight
::nWidth = nWidth
::Default()
if oFont != nil
::SetFont( oFont )
endif
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
endif
if ::oGet != nil
::oGet:hWnd = GetWindow( ::hWnd, GW_CHILD )
::oGet:Link()
::oGet:bLostFocus = ;
{| hCtlFocus, nAt, cItem| cItem := GetWindowText( ::hWnd ), ;
nAt := ::SendMsg( CB_FINDSTRING, 0, Trim( cItem )) + 1,;
Eval( ::bSetGet, cItem ),;
::Select( nAt ),;
SetWindowText( ::hWnd, cItem ),;
If( ::bValid != nil .and. ;
GetParent( hCtlFocus ) == GetParent( ::hWnd ),;
If( ! Eval( ::bValid ),;
PostMessage( ::hWnd, WM_SETFOCUS ),),) }
endif
if lDesign
::CheckDots()
endif
return Self
//----------------------------------------------------------------------------//
METHOD ReDefine( nId, bSetGet, aItems, oWnd, nHelpId, bValid, ;
bChange, nClrFore, nClrBack, cMsg, lUpdate, ;
bWhen, acBitmaps, bDrawItem, nStyle, cPict, ;
bEChange ) CLASS TComboBox
if nClrFore == nil
nClrBack := GetSysColor( COLOR_WINDOW )
endif
DEFAULT aItems := {},;
nClrFore := GetSysColor( COLOR_WINDOWTEXT ),;
lUpdate := .f., ;
nStyle := CBS_DROPDOWNLIST
::nId = nId
::hWnd = 0
::aItems = aItems
::bChange = bChange
::bSetGet = bSetGet
::oWnd = oWnd
::nHelpId = nHelpId
::bValid = bValid
::nAt = 0
::lDrag = .f.
::lCaptured = .f.
::cMsg = cMsg
::lUpdate = lUpdate
::bWhen = bWhen
::bDrawItem = bDrawItem
::nStyle = nStyle
if acBitmaps != nil
::SetBitmaps( acBitmaps )
else
::lOwnerDraw = .f.
endif
::SetColor( nClrFore, nClrBack )
if nAnd( ::nStyle, CBS_DROPDOWNLIST ) == CBS_DROPDOWN
::oGet := TGet():ReDefine( nil, ; // ID not used
::bSetGet, ; // bSETGET(uVar)
Self, ; // oDlg
::nHelpID, ; // Help Context ID
cPict, ; // Picture
nil, ; // Valid is handled by the CBx
::nClrText,;
::nClrPane,;
::oFont, ; // <oFont>
nil, ; // <oCursor>
cMsg, ; // cMsg
nil, ; // <.update.>
nil, ; // <{uWhen}>
bEChange, ; // {|nKey,nFlags,Self| <uEChange>}
.F. ) // <.readonly.> )
endif
oWnd:DefControl( Self )
return Self
//----------------------------------------------------------------------------//
METHOD Add( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt == 0
AAdd( ::aItems, cItem )
else
ASize( ::aItems, Len( ::aItems ) + 1 )
AIns( ::aItems, nAt )
::aItems[ nAt ] = cItem
endif
::SendMsg( CB_ADDSTRING, nAt, Ansitowide( cItem ) )
return nil
//----------------------------------------------------------------------------//
METHOD Change() CLASS TComboBox
local cItem := GetWindowText( ::hWnd ) // Current Value
local nAt
nAt = ::SendMsg( CB_GETCURSEL ) + 1
if nAt == ::nAt .and. ! Empty( Eval( ::bSetGet ) )
return nil
endif
::nAt := nAt
if ::nAt != 0 .and. ::nAt <= Len( ::aItems )
if ValType( Eval( ::bSetGet ) ) == "N"
Eval( ::bSetGet, ::nAt )
else
Eval( ::bSetGet, ::aItems[ ::nAt ] )
endif
endif
if ::oGet != nil // Always not nil for dropdown
::oGet:VarPut( Eval( ::bSetGet ) ) // udate variable before calling bChange
::oGet:Refresh()
endif
if ::bChange != nil
Eval( ::bChange, Self, cItem )
endif
return nil
//----------------------------------------------------------------------------//
METHOD DefControl( oControl ) CLASS TComboBox
if ::aControls == nil
::aControls = {}
endif
AAdd( ::AControls, oControl )
return nil
//----------------------------------------------------------------------------//
METHOD Set( cNewItem ) CLASS TComboBox
local nAt
if ValType( cNewItem ) == "N"
nAt = cNewItem
if nAt == 0
nAt = 1
endif
else
nAt = AScan( ::aItems,;
{ | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cNewItem ) ) } )
endif
if ValType( cNewItem ) == "N" .or. nAt != 0
::Select( nAt )
Eval( ::bSetGet, cNewItem )
else
cNewItem := cValToChar( cNewItem )
Eval( ::bSetGet, cNewItem )
SetWindowText( ::hWnd , cNewItem )
endif
return nil
//----------------------------------------------------------------------------//
METHOD KeyChar( nKey, nFlags ) CLASS TComboBox
local lAccept
do case
case nKey == VK_TAB .or. nKey == VK_RETURN
if ::bChange != nil
lAccept = Eval( ::bChange, nKey, nFlags, Self )
if ValType( lAccept ) == "L" .and. lAccept
::oWnd:GoNextCtrl( ::hWnd )
endif
else
::oWnd:GoNextCtrl( ::hWnd )
endif
if nKey == VK_RETURN // Execute DEFPUSHBUTTON Action
Super:KeyChar( nKey, nFlags )
endif
return 0
otherwise
return Super:KeyChar( nKey, nFlags )
endcase
return nil
//----------------------------------------------------------------------------//
METHOD LostFocus() CLASS TComboBox
local nAt := ::SendMsg( CB_GETCURSEL )
Super:LostFocus()
if nAt != CB_ERR
::nAt = nAt + 1
if ValType( Eval( ::bSetGet ) ) == "N"
Eval( ::bSetGet, nAt + 1 )
else
Eval( ::bSetGet, ::aItems[ nAt + 1 ] )
endif
else
Eval( ::bSetGet, GetWindowText( ::hWnd ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Modify( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
::aItems[ nAt ] = cItem
::SendMsg( CB_DELETESTRING, nAt - 1 )
::SendMsg( CB_INSERTSTRING, nAt - 1, ansitowide( cItem ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Insert( cItem, nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
ASize( ::aItems, Len( ::aItems ) + 1 )
AIns( ::aItems, nAt )
::aItems[ nAt ] = cItem
::SendMsg( CB_INSERTSTRING, nAt - 1, ansitowide( cItem ) )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Del( nAt ) CLASS TComboBox
DEFAULT nAt := 0
if nAt != 0
ADel( ::aItems, nAt )
ASize( ::aItems, Len( ::aItems ) - 1 )
::SendMsg( CB_DELETESTRING, nAt - 1 )
endif
return nil
//----------------------------------------------------------------------------//
METHOD GetDlgCode( nLastKey ) CLASS TComboBox
if Len( ::oWnd:aControls ) == 1
return DLGC_WANTALLKEYS
endif
::oWnd:nLastKey = nLastKey
return DLGC_WANTALLKEYS
//----------------------------------------------------------------------------//
METHOD Initiate( hDlg ) CLASS TComboBox
Super:Initiate( hDlg )
::Default()
if ::oGet != nil
::oGet:hWnd = GetWindow( ::hWnd, GW_CHILD )
::oGet:Link()
::oGet:bLostFocus = ;
{| hCtlFocus, nAt, cItem| cItem := GetWindowText( ::hWnd ), ;
nAt := ::SendMsg( CB_FINDSTRING, 0, Trim( cItem )) + 1,;
Eval( ::bSetGet, cItem ),;
::Select( nAt ),;
SetWindowText( ::hWnd, cItem ),;
If( ::bValid != nil .and. ;
GetParent( hCtlFocus ) == GetParent( ::hWnd ),;
If( ! Eval( ::bValid ),;
PostMessage( ::hWnd, WM_SETFOCUS ),),) }
endif
::Refresh()
return nil
//----------------------------------------------------------------------------//
METHOD Default() CLASS TComboBox
local cStart := Eval( ::bSetGet )
if ! Empty( ::hWnd ) .and. ::nStyle == CBS_DROPDOWNLIST
::nStyle := GetWindowLong( ::hWnd, GWL_STYLE )
endif
if Empty( cStart )
Eval( ::bSetGet, If( Len( ::aItems ) > 0, ::aItems[ 1 ], "" ) )
cStart = If( Len( ::aItems ) > 0, ::aItems[ 1 ], "" )
endif
AEval( ::aItems, { | cItem, nAt | ::SendMsg( CB_ADDSTRING, nAt, ansitowide( cItem ) ) } )
if ValType( cStart ) != "N"
::nAt = AScan( ::aItems, { | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cStart ) ) } )
else
::nAt = cStart
endif
::nAt = If( ::nAt > 0, ::nAt, 1 )
if cStart == nil
::Select( ::nAt )
else
::Set( cStart )
endif
return nil
//----------------------------------------------------------------------------//
METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TComboBox
local nResult := Super:MouseMove( nRow, nCol, nKeyFlags )
return If( ::lDrag, nResult, nil ) // We want standard behavior !!!
//----------------------------------------------------------------------------//
METHOD SetBitmaps( acBitmaps ) CLASS TComboBox
local n
::lOwnerDraw = .t.
if acBitmaps != nil
::aBitmaps = Array( Len( acBitmaps ) )
for n = 1 to Len( acBitmaps )
if File( acBitmaps[ n ] )
::aBitmaps[ n ] = ReadBitmap( 0, acBitmaps[ n ] )
else
::aBitmaps[ n ] = LoadBitmap( GetResources(), acBitmaps[ n ] )
endif
next
::nBmpHeight = nBmpHeight( ::aBitmaps[ 1 ] )
::nBmpWidth = nBmpWidth( ::aBitmaps[ 1 ] )
endif
return nil
//----------------------------------------------------------------------------//
METHOD Destroy() CLASS TComboBox
local n
if ::aBitmaps != nil
for n = 1 to Len( ::aBitmaps )
DeleteObject( ::aBitmaps[ n ] )
next
endif
if ::oGet != nil
::oGet:End()
endif
return Super:Destroy()
//----------------------------------------------------------------------------//
METHOD DrawItem( nIdCtl, nPStruct ) CLASS TComboBox
return LbxDrawItem( nPStruct, ::aBitmaps, ::aItems, ::nBmpWidth, ::bDrawItem )
//----------------------------------------------------------------------------//
METHOD VarGet() CLASS TComboBox
local cRet, nAt := ::SendMsg( CB_GETCURSEL )
if nAt != CB_ERR
::nAt = nAt + 1
cRet := ::aItems[ nAt + 1 ]
else
cRet := GetWindowText( ::hWnd )
endif
return cRet
//----------------------------------------------------------------------------//
METHOD lValid() CLASS TComboBox
local lRet := .t.
if ValType( ::bValid ) == "B"
lRet = Eval( ::bValid, ::oGet )
endif
return lRet
//----------------------------------------------------------------------------//
METHOD ShowToolTip() CLASS TComboBox
local nOldBottom
nOldBottom = ::nBottom
::nBottom = ::nTop + GetTextHeight( ::hWnd ) + 8
Super:ShowToolTip()
::nBottom = nOldBottom
return nil
//----------------------------------------------------------------------------//
static function IsAppThemed()
return .f.
[/code:28a7nwsu]Lo unico que he modificado es que la función FW_ANSITOWIDE no la encontraba y la he sustituido por ANSITOWIDE.De esta forma, la unica diferencia que veo con antes (aunque he visto que la clase internamente tiene varios cambios) es que sale por defecto en azul el combo y que se expande menos posiciones.Muchas Gracias |
Combos FWPPC 8.10 | Mike,El tamano lo puedes establecer con:@ ..., ... COMBOBOX ... SIZE nAncho, nAltoEntonces, te ha funcionado bien ? |
Combos FWPPC 8.10 | Ya hize los cambios y lo curioso es que algunos combos si los abre y otros no.
Veo en el foro que han tenido problemas con los combos y el nuevo windows mobile 6.1
Por eso preguntaba si alguien tiene el último build y el windows mobile. Que pueda decirme si los combos funcionan correctamente.
Gracias
Fernando |
Combox . modificación de combobox | Hola amigos,
He modificado algo a la combobox nativa de FWH, para hacer algo de busqueda incremental.
Hasta el momento lo catalogo como semi-incremental.
dejo el link de descarga.
El ejemplo es el 2 combo del ejemplo, viene un arreglo teniendo items del uno al quince.
en el segundo combo, ustedes teclean "cat" por ejemplo y aparece la primera aparicion en la lista, es decir, "catorce"
saludos, falta hacer el salto en la lista desplergada para que fuese incremental totalmente, toda la ayuda y/o comentarios son bienvenidos.
[url:3hfbw1gf]http://www.uploading.com/files/RVUHWP2J/combox.rar.html[/url:3hfbw1gf]
william morales |
Combox . modificación de combobox | William,
La actual clase TComboBox de FWH proporciona búsqueda incremental |
Combox . modificación de combobox | [quote="Antonio Linares":1m3j99d0]William,
La actual clase TComboBox de FWH proporciona búsqueda incremental[/quote:1m3j99d0]
Algun ejemplito?
gracias |
Combox . modificación de combobox | William,
Desde FWH 7.01 está disponible.
Puedes usar cualquier combobox y comenzar a teclear los caracteres de un item, y la búsqueda incremental lo localiza |
Combox . modificación de combobox | Antonio una consulta con respecto al combobox, estoy tratando de que quede lo mas amigable posible, en la version de 16 bits cuando seleccionaba datos en el combobox para modificar de una opcion a otra solo bastaba con tocar el mouse en cualquier parte de la pantalla y quedaba seleccionado la opcion digitada, porque ahora en la 7.01 si no le presionas el enter no lo asigna cuando estas modificando si no que deja el dato antiguo
gracias |
Combox Enlasados | Estimados
Como puedo enlasar 2 o mas combox
La idea es según el contenido que se seleccione en un Combox se me actualice el siguiente Combox, en base a una funcion que hace dicha actualizacion don los datos salen del primer Combox
mmm fui claro
muchas gracias
David
Argentina |
Combox Enlasados | Aca paso la rutina
[code=fw:1kvvsrra]<div class="fw" id="{CB}" style="font-family: monospace;"> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx_001 <span style="color: #0000ff;">VAR</span> cCbx_001 <span style="color: #0000ff;">PROMPTS</span> mCbx_001 ;<br /> <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">40</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> mCbx_002:=ArmaTipoDocu<span style="color: #000000;">(</span>VAL<span style="color: #000000;">(</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>cCbx_001,<span style="color: #000000;">201</span>,<span style="color: #000000;">18</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,;<br /> cCbx_002:=mCbx_002<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ,;<br /> oCbx_002:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> mCbx_002:=ArmaTipoDocu<span style="color: #000000;">(</span>VAL<span style="color: #000000;">(</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>cCbx_001,<span style="color: #000000;">201</span>,<span style="color: #000000;">18</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,;<br /> cCbx_002:=mCbx_002<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ,;<br /> oCbx_002:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> , .T. <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">Of</span> oDlgCar<br /><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx_002 <span style="color: #0000ff;">VAR</span> cCbx_002 <span style="color: #0000ff;">PROMPTS</span> mCbx_002 <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">40</span> ;<br /> <span style="color: #0000ff;">Of</span> oDlgCar</div>[/code:1kvvsrra]
la variable mCbx_002 la actualizo con los Items que debo mostrar en el segundo COMBOX.
Haciendo control dicha variable se Actualiza pero NO se muestra en el 2° COMBOX
David
Argetnina |
Combox Enlasados | use los methodos
para reasignar items
SetItems( aItems, aList )
salu2 |
Combox Enlasados | Hola estimados...
Como me sujeris hacerlo ?
David |
Combox Enlasados | Amigo prueba asi
REDEFINE COMBOBOX aGetS[12] VAR fpago ITEMS forpago ID 112 OF oDlg;
ON CHANGE (CargaFormaPago(oDlg,@acDevuelve,fpago,aGets,nTotTot),aGetS[13]:SetItems(acDevuelve),aGets[13]:SetFocus(),xpagar:=0) UPDATE
REDEFINE COMBOBOX aGetS[13] VAR FPagar ITEMS acDevuelve ID 113 OF oDlg;
ON CHANGE (aGets[40]:Refresh(),aGets[35]:SetFocus(),Refrpago(fPagar,aGets,nTotTot) ) UPDATE
Saludos |
Combox Enlasados | Hola David:
[quote="dobfivewin":233m4ata]La idea es según el contenido que se seleccione en un Combox se me actualice el siguiente Combox, en base a una funcion que hace dicha actualizacion don los datos salen del primer Combox[/quote:233m4ata]
Aquí tienes un pequeño ejemplo funcional:
[code=fw:233m4ata]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg, nVar, nVar1, aCbx<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, ;<br /> aArr := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Uno"</span>, <span style="color: #ff0000;">"Dos"</span>, <span style="color: #ff0000;">"Tres"</span> <span style="color: #000000;">}</span>, ;<br /> aUno := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Uno Uno"</span>, <span style="color: #ff0000;">"Uno Dos"</span>, <span style="color: #ff0000;">"Uno Tres"</span> <span style="color: #000000;">}</span>, ;<br /> aDos := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Dos Uno"</span>, <span style="color: #ff0000;">"Dos Dos"</span>, <span style="color: #ff0000;">"Dos Tres"</span> <span style="color: #000000;">}</span>, ;<br /> aTres := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Tres Uno"</span>, <span style="color: #ff0000;">"Tres Dos"</span>, <span style="color: #ff0000;">"Tres Tres"</span> <span style="color: #000000;">}</span><br /><br /> nVar := nVar1 := <span style="color: #000000;">1</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Combos Enlazados"</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> aCbx<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nVar <span style="color: #0000ff;">ITEMS</span> aArr <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">90</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> aCbx<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nVar == <span style="color: #000000;">1</span>, aUno, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nVar == <span style="color: #000000;">2</span>, aDos, aTres <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">COMBOBOX</span> aCbx<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nVar1 <span style="color: #0000ff;">ITEMS</span> aUno <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">90</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:233m4ata]
Un abrazo.
Manuel Mercado |
Combox Enlasados | Estimados Carlos Vargas, jbrito y Manuel Mercado
MUCHAS GRACIAS
Me solucionaron el problema.
1000000 de gracias
david
argentina |
Combox Enlasados | Manuel
Saludo Cordial
Serias tan amable y me explicas como con tu ejemplo lo hago desde DBFs
Gracias Manuel
Un Abrazo
Jairo Barbosa |
Combox and escape | Hello,
I have 3 combo in a dialog .
When the user select a combo to view all the items and then press Esc,
all the dialog is closed and not only the combo list .
How to close only the combo List ??
REDEFINE COMBOBOX oCb8 VAR wG[36] ITEMS VPROBA ;
STYLE CBS_DROPDOWN ;
COLOR "B*/W+" ;
ID 131 OF oDlgrv |
Combox and escape | Dear Mr.Jack,
Which FWH version do you use?.
This problem is fixed in FWH 8.12
[quote:yhct8q02]* New: Class TComboBox Method KeyDown(). An open combobox on a dialog will properly close when Escape is pressed and the dialog will not be closed. [/quote:yhct8q02]
Regards
Anser |
Combox and escape | Thanks for this help,
I is working .
Thanks ! |
Combox con 2 columnas | Amigos....Se pude armar un Combox donde se visualizan 2 columans en la fila??Chas graciasDbarrioArgentina |
Combox con 2 columnas | puedes probar con [url:11bh4w9x]ftp://ftp.quiquesoft.com/fivewin/qcombrow.zip[/url:11bh4w9x] tal vez te ayude |
Come beccare i messaggi da un file DBX di Outlook Express | Ciao a tutti,
mi occorrerebbe un'idea (se esiste) x prelevare singolarmente e in automatico i messaggi da un file DBX di Outlook Express x poterli processare poi.
C'e' qualcosa che posso usare/utilizzare ?
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | Ho sbagliato a porre qui la domanda,.....scusate |
Come beccare i messaggi da un file DBX di Outlook Express | Ciao a tutti,
mi occorrerebbe un'idea (se esiste) x prelevare singolarmente e in automatico i messaggi da un file DBX di Outlook Express x poterli processare poi.
C'e' qualcosa che posso usare/utilizzare ?
Grazie
Ho prima postato questa richiesta sul forum internazionale poi mi sono accorto che EMG aveva gia' risposto ad un quesito similare (almeno mi pareva) |
Come beccare i messaggi da un file DBX di Outlook Express | Sì, puoi usare, appunto, OLE:
[code:2wht0f9b]#define olFolderInbox 6
FUNCTION MAIN()
LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
LOCAL oInbox := oNameSpace:GetDefaultFolder( olFolderInbox )
LOCAL i
FOR i = 1 TO oInbox:Items:Count
? oInbox:Items[ i ]:Body
?
NEXT
oOutlook:Quit()
INKEY( 0 )
RETURN NIL[/code:2wht0f9b]
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Ho provato il seg. esempio:
*************************
#include "FiveWin.ch"
#define olFolderInbox 6
FUNCTION MAIN()
LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
LOCAL oInbox := oNameSpace:GetDefaultFolder( olFolderInbox )
LOCAL i
FOR i = 1 TO oInbox:Items:Count
? oInbox:Items[ i ]:Body
?
NEXT
oOutlook:Quit()
INKEY( 0 )
return nil
******************
con FWH24 e mi fa partire intanto il Microsoft Outlook (ma io i messaggi ce l'ho in OutLook Express)
ma subito mi da il seg errore:
Class: NIL has no exported method: BODY
Posso fare qualcosa ? Ma sopratutto posso leggere i Body (e magari anche gli eventuali codici di errore delle email, es: email non esistente,spazio esaurito,ecc) e io poi uso Outlook Express.
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | Mi era sfuggito il fatto che tu parlavi di Outlook Express. OLE può essere utilizzato solo con Outlook di Office. Non ho nessuna idea su come fare quello che chiedi con OE.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Ok, vorra' dire che passo a Microsoft Outlook.
Si riesce in questo caso a fare funzionare l'esempio sopre che mi hai mandato oppure ho bisogno di qualche libreria o aggiornamento delle mie FWH24 ?
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | Non fa niente <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Come beccare i messaggi da un file DBX di Outlook Express | Forse partendo da questo esempio trovat nelne news si riesce a risolvere il mio problema:
Code:
oOL := TOleAuto():New( "Outlook.Application" )
lOutlookOK := .T.
IF ! lOutlookOK
RETURN ( 0 )
ENDIF
oNameSpace = oOL:Get( "GetNameSpace", "MAPI" )
oContacts = oNameSpace:Get( "GetDefaultFolder", "6" ) // 6 = Inbox-Folder
FOR nContador = 1 TO oContacts:ITEMS:Count()
oNewContact = oContacts:ITEMS( nContador )
cSenderName := oNewContact:get( "SenderName" )
cSubject := oNewContact:get( "Subject" )
cBody := oNewContact:get( "Body" ) && questo l'ho inserito io grazie al tuo sempio e funziona
* quali sono tutte le altre informazioni che posso beccare ?
* ho provato a cercare nel web e nel mio pc il file: VBAOUTL?.CHM che mi poteva aiutare ma.... non ho trovato niente, per la verita' mi occorrerebbe qualche codice di risposta della email del tipo Non esestente,spazio email insuff, ecc...
NEXT nContador
RETURN NIL
Ci siamo quasi, un ultimo sforzo
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | [quote="Romeo":yfzewxez]Ok, vorra' dire che passo a Microsoft Outlook.
Si riesce in questo caso a fare funzionare l'esempio sopre che mi hai mandato oppure ho bisogno di qualche libreria o aggiornamento delle mie FWH24 ?
Grazie[/quote:yfzewxez]
Sì, dovrebbe funzionare regolarmente.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Non capisco cosa ti serve. Se il mio esempio ti funziona credo che tu non abbia bisogno di altro.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Ok l'esempio va bene e mi chiedevo se oltre al Body, posso avere anche altre variabili, ese: email di chi mi risponde, il codice di errore (se esiste).
certo potrei farlo analizzando riga x riga il body...ma se esistono le funzioni gia fatte e' meglio.
Il progrmma che devo relizzare dovra' mandare delle email (tantissime) e poi analizzare le risposte in maniera piu' automatico possibile.
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | Cerca l'oggetto MailItem sulla documentazione e troverai tutte le sue proprietà disponibili.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Ho cercato nelle cartelle e sottocartelle di fwh24 e nelle classi ma non ho trovato alcun riferimento a menuitem.
Forse ho una versione datata? (FWH24)
Grazie |
Come beccare i messaggi da un file DBX di Outlook Express | Ops, chiaramento cercato Mailitem
Mi viene un dubbio che io debba cercare nella documentazione del file VBAOUTL*.CHM di microsoft che io non ho !!
Romeo |
Come beccare i messaggi da un file DBX di Outlook Express | FWH non c'entra niente. Devi cercare nella documentazione di Outlook (VBAOUTL*.CHM).
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | [quote="Romeo":2zkqw394]Ops, chiaramento cercato Mailitem
Mi viene un dubbio che io debba cercare nella documentazione del file VBAOUTL*.CHM di microsoft che io non ho !!
Romeo[/quote:2zkqw394]
Infatti. Ma se hai installato Office ce l'hai certamente, se non sull'hard disk sicuramente sul CD.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | Ho il cd rom di Office XP 2002 e non ho trovato il fiel VBAOUTL9.CHM ma l'ho trovato su office 97.
Ho provato a guardare Mailitem ma dopo un po di tentativi ho rinunciato a cercare le altre funzioni poiche' non le trovo, sicuramente ci sono ma non risco a trovarle!
Grazie comunque
Romeo |
Come beccare i messaggi da un file DBX di Outlook Express | [quote="Romeo":2hsoz80x]Ho il cd rom di Office XP 2002 e non ho trovato il fiel VBAOUTL9.CHM[/quote:2hsoz80x]
Infatti devi cercare VBAOUTL*.CHM.
[quote="Romeo":2hsoz80x]Ho provato a guardare Mailitem ma dopo un po di tentativi ho rinunciato a cercare le altre funzioni poiche' non le trovo, sicuramente ci sono ma non risco a trovarle![/quote:2hsoz80x]
Hai trovato l'oggetto MailItem? Ecco, in alto trovi il link Proprietà. Clickalo e verranno fuori tutte le proprietà di quell'oggetto, tipo Body, etc. Non mi pare così difficile. Alla peggio cerca su Internet.
EMG |
Come beccare i messaggi da un file DBX di Outlook Express | si grazie, ho trovato qualcosa che mi interessa su MSDN |
Come inserire una immagine in un post | Ciao a tutti
Ho provato ad inserire un'immagine per rendere evidente un difetto, ho usato il TAG Img
ma non ci sono riuscito.
Vorrei un chiarimento in merito.
Grazie
Maurizio Menabue |
Come inserire una immagine in un post | <!-- m --><a class="postlink" href="https://postimages.org/">https://postimages.org/</a><!-- m -->
quando la carichi devi selezionare il secondo
[img:xt135p69]https://i.postimg.cc/13jsHxs9/kkkkkkkkkkkkkkkkkkkk.jpg[/img:xt135p69] |
Come leggere i files Help con Vista | Salve,
ho un PC con vista e non riesco a leggere/visualizzare i files di Help (.hlp) di Fivewin/Harbour.
Come posso fare ?
Grazie e Auguri a tutti
Romeo/Zingoni |
Come leggere i files Help con Vista | Nella cartella manual delle FWH trovi anche i file CHM.
EMG |
Come leggere i files Help con Vista | Romeo,
potresti installare il programma di windows per leggere i files .hlp, quando cerchi di aprire un hlp su vista ti apare l'aiuto e ti dice da dove scaricare questo programma.
comunque, questo è il link.
<!-- m --><a class="postlink" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6ebcfad9-d3f5-4365-8070-334cd175d4bb&displaylang=en">http://www.microsoft.com/downloads/deta ... laylang=en</a><!-- m -->
ciao |
Come leggere i files Help con Vista | OK, grazie mille, risolto con il download del file linkato. |
Come leggere i files Help con Vista | Scusa, giusto per curiosità: perché non puoi utilizzare i file CHM forniti con le FWH?
EMG |
Come leggere i files Help con Vista | Scusa, non ti ho risposto perche' non ho piu' letto i messaggi.
COmunque, pare strano, ma in alcune versioni di fwin (es 1.95) non TROVO i files CHM, mentre ci sono sempre i .HLP.
CIao |
Come leggere i files Help con Vista | 1.95??? Spero tu abbia sbagliato a scrivere! Non ti pare un po' vecchiotta? Forse a quell'epoca neanche esistevano i CHM.
EMG |
Come reperire il nome oggetto 'constraint' | Ciao a tutti
Non riesco a sapere il modo per leggere il nome dell'oggetto creato con la clausola constraint associato ad una certa colonna
in MSSQL sia utilizzanto un comando SQl o una qualche proprietà legata alla colonna es.: cNameContraist := oRs:fields( cNameField ):constraint()
mi serve per poter poi scrivere :
[code=fw:1ww74bx7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> cSql := <span style="color: #ff0000;">"ALTER TABLE "</span> + cNameTable<br /> cSql += <span style="color: #ff0000;">" DROP CONSTRAINT IF EXISTS"</span> + <span style="color: #ff0000;">" ["</span> + cNameConstraint + <span style="color: #ff0000;">"] ;"</span><br /> oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">(</span> cSql <span style="color: #000000;">)</span><br /> <br /> cSql := <span style="color: #ff0000;">"ALTER TABLE "</span> + cNameTable<br /> cSql += <span style="color: #ff0000;">" DROP COLUMN"</span> + <span style="color: #ff0000;">" ["</span> + cNameField + <span style="color: #ff0000;">"] ;"</span><br /> oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">(</span> cSql <span style="color: #000000;">)</span><br /><br /> </div>[/code:1ww74bx7]
Grazie ! |
Comentario sobre una busqueda... | Hola a todos...
Lo que pretendo es que al introducir un código me realice una búsqueda en la tabla de articulos y me muestre el nombre de este y la cantidad. El codigo que estoy usando es el siguiente...
Alguien podría decirme si este codigo está mal?
.....
DEFINE FONT oFont NAME "Courier New" SIZE 6, -14
odlg:bKeyChar = { | nKey, nFlags | Search_art(nKey,@cSearch,Nombre ),oSay:REFRESH()}
redefine say oSay prompt cSearch id 130 of odlg
redefine get oGetNombre var nombre id 4004 of odlg
odlg:REFRESH()
ACTIVATE dialog odlg
y la llamada a search_art es la siguiente
*--------------------------------------------------
function Search_art( nKey, cSearch,Nombre )
*--------------------------------------------------
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
ENDIF
articulos->( DbSeek( cSearch, .t. ) )
nombre:=articulos->nom_art
return nil
La verdad es que no veo en que está fallando... Por cierto si pongo en la funcion de arriba el nkey=13, ¿estoy preguntando si se ha pulsado la tecla intro?
Un saludo y gracias..
Elías Torres |
Comentario sobre una busqueda... | Hola a todos...
Al final creo que he solucionado el tema con lo que tenia, pero lo que pasa es que no se como refrescar un get....
La informacion a buscar la quiero poner en :
redefine get oGetNombre var articulos->nom_art id 4004 of odlg
He probado a refrescar el odlg completo pero no me refresca ese get. El valor que tiene articulos->nom_art despues de la busqueda es correcto porque pongo un msginfo(articulos->nom_art) y cambia dependiendo de la busqueda, pero luego no me lo pone en el GET..
Alguien sabe por que?
Un saludo y gracias..
Elías Torres. |
Comentario sobre una busqueda... | Elias prueba
oGetNombre:Refresh()
Saludos |
Comentario sobre una busqueda... | Gracias wilsongamboa, efectivamente era esa boberia....
Una curiosidad, a ver si alguien me puede responder.. Si mirais el procedimiento de arriba vereis que en nkey controlo la tecla que se pulsa. Hasta ahi correcto. Pero mi sorpresa viene cuando compruebo que la tecla intro, tanto en el teclado virtual con en el otro, no tiene su correspondiente numeración. Me explico, si se pulsa la tecla de borrar y ponemos msginfo(nkey) nos devuelve un 8, si pulsamos el espacio nos devuelve un 32 (creo) pero cuando se pulsa en el intro no hace nada. Es como que no tiene accion ninguna. ¿Alguien sabe porque ocurre esto, y si tiene alguna solución?. En mi caso lo que pretendo hacer es que escribo un codigo y hasta que no le de al intro no realiza la actualizacion de la pantalla, pero claro por ahora lo tengo para que me funcione al pulsar el espacio, pero me gustaria que fuera con la tecla intro.
Un saludo y gracias..
Elías Torres. |
Comentario sobre una busqueda... | Elías,
Por favor muestra el código de cómo lo estás haciendo, gracias |
Comentario sobre una busqueda... | Perdona Antonio, se me paso poner el codigo....
Bueno, estas son las dos funciones que estoy utilizando. Lo que pretendo hacer es un inventario, en el que al introducir un codigo muestre la descripcion y las cantidades(estas ultimas se podrán modificar) y asi sucesivamente....
Yo creo que el motivo por el que no funciona el intro (ni en el emulador ni en el teclado) es por el procedimiento de busqueda que realizo, pero mi duda es porque el borrar si lo hace....
Si tienes alguna sugerencia de como realizar la busqueda una vez introducido el codigo, comentamela...te lo agradeceria mucho.
El codigo es el siguiente....
******************
FUNCTION Registros()
******************
local oDlg
LOCAL oGetInventario, oGetNombre, oGetAcumulado, oGetCantidad, LOCAL oGetFecha, cantidad:=0,acumulado:=0, cSearch := "",nombre
SELECT inventario
IF EOF()
c=1
ELSE
inventario->(dbgobottom())
c=val(inventario->numdoc)+1
endif
oGetInventario_cod=RIGHT(STR(1000000+c),6)
oGetFecha=(DTOC(date())+' '+cValToChar((TIME())))
Inventario->(dbappend())
inventario->numdoc:=oGetInventario_cod
inventario->fecha_doc:=oGetFecha
showkeyboard()
(cAliasInventario)->(DbSeek((cAliasArticulos)->cod_art,.t.))
DEFINE dialog odlg resource "Inventario"
redefine group ogrp id 600 of odlg color CLR_RED,RGB(230,184,94)
DEFINE font oFont2 name "Courier New" bold
redefine say id 4001 of odlg color CLR_RED, RGB(230,184,94)
redefine say id 4002 of odlg color CLR_RED, RGB(230,184,94)
redefine say id 4003 of odlg color CLR_RED, RGB(230,184,94)
redefine say id 120 of odlg color CLR_RED, RGB(230,184,94)
redefine say id 4010 of odlg color RGB(1,1,1),RGB(230,184,94)
redefine say id 4011 of odlg color RGB(1,1,1),RGB(230,184,94)
DEFINE FONT oFont NAME "Courier New" SIZE 6, -14
redefine say oSay prompt cSearch id 130 of odlg COLOR CLR_BLACK, CLR_WHITE
oSay:bKeyChar = { | nKey, nFlags | Search_art( nKey, @cSearch),oSay:REFRESH(),oGetNombre:Refresh()}
redefine get oGetAcumulado var acumulado id 4007 of odlg
redefine get oGetCantidad var cantidad id 4005 of odlg
redefine get oGetNombre var articulos->nom_art id 4004 of odlg
redefine get oGetNumDoc var oGetInventario_cod id 4008 of odlg
redefine get oGetFecha_Doc var oGetFecha id 4009 of odlg
odlg:setcolor(RGB(1,1,1),RGB(230,184,94))
inventario->codigo:=articulos->cod_art
inventario->pvp:=articulos->precio
inventario->nombre:=articulos->nom_art
inventario->stock:= acumulado
inventario->cant:= cantidad
ACTIVATE dialog odlg;
on init barra_desplazamiento( odlg)
oFont:End()
RETURN nil
************************************
function Search_art( nkey,cSearch,nombre )
************************************
if nKey = 8 &&equivale a pulsar la tecla de borrar
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
ENDIF
IF nKey = 32 &&equivale a pulsar el espacio
articulos->( DbSeek( ALLTRIM(@cSearch)),.t.)
cSearch=""
endif
return nil
Un saludo y gracias.
Elías Torres. |
Comentario sobre una busqueda... | Elías,
Prueba a usar:
oSay:bKeyDown = { | nKey, nFlags | If( nKey == VK_RETURN, MsgInfo( "return" ),) } |
Comentario sobre una busqueda... | Antonio, he probado lo que me has dicho pero no funciona. En nkey no se registra el VK_RETURN. Cualquier otra cosa si pero ese no....
Saludos...
Elías Torres. |
Comentario sobre una busqueda... | Elías,
Este ejemplo funciona correctamente:
[code:31l9bx48]
// FiveWin for Pocket PC - Testing browses with incremental search
#include "FWCE.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
INDEX ON Customer->Last TO "LAST"
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),;
oSay:Refresh() }
@ 14, 2 SAY "Searching:" SIZE 60, 30
@ 14, 12 SAY oSay PROMPT cSearch SIZE 80, 30
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function Search( nKey, cSearch )
#define VK_RETURN 13
if nKey == VK_RETURN
MsgInfo( "ok" )
endif
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
endif
Customer->( DbSeek( cSearch, .t. ) )
return nil
//----------------------------------------------------------------------------//
[/code:31l9bx48] |
Comentario sobre una busqueda... | Antonio, efectivamente el ejemplo que me pasas funciona correctamente pero para mi aplicacion no va..... He estado comparandolos y la unica diferencia que veo es que en el ejemplo se trabaja con un browse y mi aplicacion con un say, ¿puede ser ese el problema?..
**********
Mi aplicacion
**********
oSay:bKeyChar = { | nKey, nFlags | Search_art( nKey, @cSearch),oSay:REFRESH(),oGetNombre:Refresh()}
**********
El ejemplo
**********
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),oSay:Refresh() }
Ademas he colocado el #define VK_RETURN 13 en el Search(nkey,@cSearch) porque eso si que no lo tenia, pero nada, no va....
Un saludo y gracias.
Elías Torres. |
Comentario sobre una busqueda... | Elías,
Un SAY no responde a los eventos de teclado. No puedes usarlo. |
Comentarios en Excel | Hola a todos,Si para dar valor a una celda de Excel realizo:oHoja:Cells( 5, 23):Value := "El Valor"cómo añadiría un comentario/nota a esa misma celda?He buscado en el foro y no he visto ningún ejemplo de ello.Saludos y graciasCarlos G. |
Comentarios en Excel | Carlos,Has probado con:oHoja:Cells( 5, 23 ):Comment := "comentario"ó mejor:oHoja:Cells( 5, 23 ):AddComment()oHoja:Cells( 5, 23 ):Comment:Text := "comentario" |
Comentarios en Excel | [quote="Antonio Linares":8o00d3rx]Carlos,
Has probado con:
oHoja:Cells( 5, 23 ):Comment := "comentario"
ó mejor:
oHoja:Cells( 5, 23 ):AddComment()
oHoja:Cells( 5, 23 ):Comment:Text := "comentario"[/quote:8o00d3rx]Había probado:oHoja:Cells( 5, 23 ):Comment := "comentario"yoHoja:Cells( 5, 23 ):Comment:Text := "comentario"pero no le estaba añadiendooHoja:Cells( 5, 23 ):AddComment()Ha funcionado perfecto.Un saludo y GraciasCarlos G. |
Comentarios en Excel | Carlos,Para múltiples líneas en el comentario prueba con Chr( 10 ) en vez de CRLF |
Comentarios en Excel | Puedes usar facilmente StrTran() para cambiar de CRLF a Chr( 10 ) si el texto ya está construido |
Comentarios en Excel | [quote="Antonio Linares":izox3qs6]Puedes usar facilmente StrTran() para cambiar de CRLF a Chr( 10 ) si el texto ya está construido[/quote:izox3qs6]Gracias,Lo probaré.Buen fin de semana.Carlos G. |
Comenzando con FiveWin | Hola a todos,
Recien empiezo a trabajar con FiveWin asi que de ante mano os agradezco toda la ayuda que me podais brindar, que tengais paciencia conmigo y ojala pronto yo pueda ayudaros en algo.
Saludos a todos,
Antonio G. |
Comenzando con FiveWin | Un placer Antonio...
Bienvenido a la comunidad, estamos a la orden y publica cualquier duda que tengas... |
Comenzando con FiveWin | Hola Antonio...
Bienvenido al foro! Seguramente recibirás todas las ayudas que necesites, siempre hay buena predisposición de todos los miembros, tanto para ayudar como para aprender!!
Saludos, |
Comenzando con FiveWin | Antonio,
Bienvenido seas a este gran foro.
Verás que muchos están puestos a ayudar. |
Comenzando con FiveWin | Antonio :
Bienvenido! |
Comenzando con HB64. ERROR LNK1123 | Hola,
Estoy intentando construir un ejemplo con Harbour de 64bits, pero no después de configurar los paths tengo el siguiente errror
[code=fw:1ucemvks]<div class="fw" id="{CB}" style="font-family: monospace;">Harbour <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>Rev. <span style="color: #000000;">18881</span><span style="color: #000000;">)</span><br />Copyright <span style="color: #000000;">(</span>c<span style="color: #000000;">)</span> <span style="color: #000000;">1999</span><span style="color: #000000;">-2013</span>, http:<span style="color: #B900B9;">//harbour-project.org/</span><br />Compiling <span style="color: #ff0000;">'TUTOR02.prg'</span> and generating preprocessed output <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">'TUTOR02.ppo'</span>...<br />Lines <span style="color: #000000;">4208</span>, Functions/Procedures <span style="color: #000000;">1</span><br />Generating C source output <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">'TUTOR02.c'</span>... Done.<br />Microsoft <span style="color: #000000;">(</span>R<span style="color: #000000;">)</span> C/C++ Optimizing Compiler Version <span style="color: #000000;">16.00</span><span style="color: #000000;">.30319</span><span style="color: #000000;">.01</span> <span style="color: #00C800;">for</span> x64<br />Copyright <span style="color: #000000;">(</span>C<span style="color: #000000;">)</span> Microsoft Corporation. All rights reserved.<br /><br />TUTOR02.c<br />Microsoft <span style="color: #000000;">(</span>R<span style="color: #000000;">)</span> Windows <span style="color: #000000;">(</span>R<span style="color: #000000;">)</span> <span style="color: #0000ff;">Resource</span> Compiler Version <span style="color: #000000;">6.1</span><span style="color: #000000;">.7600</span><span style="color: #000000;">.16385</span><br />Copyright <span style="color: #000000;">(</span>C<span style="color: #000000;">)</span> Microsoft Corporation. All rights reserved.<br /><br />LINK : <span style="color: #000000;">fatal</span> error LNK1123: <span style="color: #000000;">failure</span> during conversion <span style="color: #0000ff;">to</span> COFF: <span style="color: #000000;">file</span> invalid or c<br />orrupt<br />* Linking errors *</div>[/code:1ucemvks] |
Comenzando con HB64. ERROR LNK1123 | Miguel A.,
Estas usando FWH\samples\build64.bat ?
Comprueba que estes usando las mismas librerias que se especifican en build64.bat |
Comenzando con HB64. ERROR LNK1123 | Antonio,
Despues de investigar veo que build64.bat hace referencia a unas librerias situadas en
\harbour\lib\vc64
que yo no tengo
las que tengo yo están en
\harbour\lib
pero si hago referencia a estas librerias se produce el error
[code=fw:kfq5mp27]<div class="fw" id="{CB}" style="font-family: monospace;"><br />LINK : <span style="color: #000000;">fatal</span> error LNK1123: <span style="color: #000000;">failure</span> during conversion <span style="color: #0000ff;">to</span> COFF: <span style="color: #000000;">file</span> invalid or corrupt<br />* Linking errors *<br /><br />C:\fwh64\samples><br /> </div>[/code:kfq5mp27]
Yo tengo librerias en
C:\vc64\lib pero no son las que se referencian en build64.bat
Que estoy haciendo mal?
gracias |
Comenzando con HB64. ERROR LNK1123 | Miguel A.,
La versión actual de FWH 64 utiliza el compilador de C de Visual Studio 2012 (ó 2010).
Por lo que es preciso que lo descargues desde Microsoft. La versión Visual Studio 2012 Express, que es gratuita, te sirve perfectamente.
Disculpa este cambio en FWH 64, pero lo hemos hecho con la intención de ser mucho más compatible con Visual Studio <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Comenzando con HB64. ERROR LNK1123 | gracias. |
Comenzando con TDatabase | Buenas tardes,
Debo comenzar una pequeña aplicación para trabajar en red (uso DBF's) y, como hace un tiempo un amigo del foro me recomendó usar la clase TDatabase, los consulto por este motivo.
Mi aplicación abrirá varios dialogs nowait que usarán la misma DBF y la consulta es si, debido al uso de estos nowait puedo usar alias para abrir las DBF con la clase tDatabase y, si no fuera así, ¿como debería hacerlo?.
Aclaro que revisé los samples pero en ellos no se usan dialogs nowait así que no encontré ejemplos.
Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
Comenzando con TDatabase | Amigo...
Puedes usar alias perfectamente
[code=fw:ppp8vka7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE TABLA <span style="color: #0000ff;">ALIAS</span> TuAlias <span style="color: #00C800;">NEW</span><br />DATABASE oDbf<br />...<br />...<br />...<br /> </div>[/code:ppp8vka7]
Saludos, |
Comenzando con TDatabase | Hola,
Sigo tratando de "Iniciarme" con la clase TDatabase.
Tengo un problema y es que no logro cerrar los alias abiertos cuando cierro el/los dialogs. Como habitualmente hago con los dialogs NOWAIT, intenté cerrar el alias en el valid, pero no resulta y dá un error.
Adjunto el código del PRG de prueba que es una reforma al PRG de los Salmples:
[code=fw:364ecfga]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> set resources <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">'dbfpla.dll'</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">70</span> ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing DataBase Objects"</span> ;<br /> <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"FiveWin - Object Oriented DataBase Management"</span> <span style="color: #0000ff;">CENTERED</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /> <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Do you really want to end ?"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Clients"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Hojear..."</span> <span style="color: #0000ff;">ACTION</span> ClientsBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Clients browse management dialog"</span><br /><br /> <span style="color: #0000ff;">SEPARATOR</span><br /><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Exit Test..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"End doing this tutorial"</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /> <span style="color: #00C800;">Function</span> ClientsBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBrw , oLbx , lSalir:=.f. , oDbf<br /> <span style="color: #00C800;">local</span> cClientes:=cGetNewAlias<span style="color: #000000;">(</span><span style="color: #ff0000;">'clientes'</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">static</span> oDlg<br /><br /> use CLIENTES shared <span style="color: #00C800;">new</span> <span style="color: #0000ff;">alias</span> <span style="color: #000000;">(</span>cClientes<span style="color: #000000;">)</span><br /> DATABASE oDbf<br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"XBROWSETEST"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oLbx ;<br /> FIELDS oDbf:<span style="color: #000000;">NOMBRE</span> ,;<br /> oDbf:<span style="color: #000000;">DIRECCION</span> ;<br /> HEADERS <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #ff0000;">"Dirección"</span> ;<br /> SIZES <span style="color: #000000;">250</span>, <span style="color: #000000;">300</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> oLbx:<span style="color: #000000;">bSkip</span> = <span style="color: #000000;">{</span> | nRecs | oDbf:<span style="color: #000000;">Skipper</span><span style="color: #000000;">(</span> nRecs <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">nowait</span> <span style="color: #0000ff;">valid</span> <span style="color: #000000;">(</span> oDbf:<span style="color: #000000;">close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> , .t.<span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />procedure AppSys <span style="color: #B900B9;">// XBase++ requirement</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:364ecfga]
Funciona bién pero al cerrar el dialog me dá este error:
[code=fw:364ecfga]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br /> Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">D</span>:\VERCE\BIN\Dbf03.Exe <span style="color: #000000;">(</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">1</span>,<span style="color: #000000;">596</span>,<span style="color: #000000;">416</span> bytes<br /> Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">8</span> secs <br /> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">07</span>/<span style="color: #000000;">02</span>/<span style="color: #000000;">09</span>, <span style="color: #000000;">19</span>:<span style="color: #000000;">24</span>:<span style="color: #000000;">06</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> <span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TDATABASE</span>:<span style="color: #000000;">NOMBRE</span><br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">HARBOUR</span>.PRG => _CLSSETERROR<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">DATABASE</span>.PRG => TDATABASE:<span style="color: #000000;">NOMBRE</span><span style="color: #000000;">(</span><span style="color: #000000;">410</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">dbf03</span>.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>CLIENTSBROWSE<span style="color: #000000;">(</span><span style="color: #000000;">64</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">WBROWSE</span>.PRG => TWBROWSE:<span style="color: #000000;">DRAWSELECT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">WBROWSE</span>.PRG => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TWBROWSE:<span style="color: #000000;">TWBROWSE</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWBROWSE:<span style="color: #000000;">LOSTFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">CONTROL</span>.PRG => TWBROWSE:<span style="color: #000000;">KILLFOCUS</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">CONTROL</span>.PRG => TWBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DESTROYWINDOW<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">CLOSE</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">END</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">SYSCOMMAND</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">SYSCOMMAND</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => WINRUN<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">dbf03</span>.prg => MAIN<span style="color: #000000;">(</span><span style="color: #000000;">21</span><span style="color: #000000;">)</span><br /> </div>[/code:364ecfga]
Quedo a la espera de una ayuda. Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
Comenzando con TDatabase | Hola
Creo que una de las cosas que te debes olvidar cuando utilizas objetos relacionas con Banco de Datos, en este caso Database, es olvidarte del alias.
Si revisas la clase te daras cuenta que ella sola asigna el alias (esto dependiendo de que version fw usas)
Para tu ejemplo:
-definiria varios 'oDbf's como publico (pudiendo ser um arreglo de objetos), es decir para que se "vea" en toda la aplicacion.
[code=fw:2qy48yqj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Public</span> oDbf <br /><span style="color: #B900B9;">// o</span><br /><span style="color: #00C800;">Public</span> aDbf = Array<span style="color: #000000;">(</span> <span style="color: #000000;">10</span> <span style="color: #000000;">)</span></div>[/code:2qy48yqj]
-abriria la database al inicio de la aplicacion tantas veces como sea necesario y asignandole el objeto respectivo.
[code=fw:2qy48yqj]<div class="fw" id="{CB}" style="font-family: monospace;"><br />use CLIENTES shared <span style="color: #00C800;">new</span><br />DATABASE oDbf<br /><span style="color: #B900B9;">//o</span><br />use CLIENTES shared <span style="color: #00C800;">new</span><br />DATABSE aDbf<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /><br />use CLIENTES shared <span style="color: #00C800;">new</span><br />DATABSE aDbf<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br />........<br /> </div>[/code:2qy48yqj]
-cerraria los obj al final de la aplicacion.
[code=fw:2qy48yqj]<div class="fw" id="{CB}" style="font-family: monospace;"> oDbf:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// o </span><br />AEval<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span> |o| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> o != <span style="color: #00C800;">Nil</span>, o:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span></div>[/code:2qy48yqj] |
Comenzando con TDatabase | Gracias por contestar.
Lo que Propones no se adapta a lo que necesito.
Tu propones abrir la DBF una cantidad de veces predefinida pero en mi caso estos dialogs se abrirán muchísimas veces durante la ejecución del programa y además nunca será la misma cantidad de veces.
Por esto necesito ir cerrando los alias u objetos DBF abiertos.
¿Alguna otra idea?.
Gracias.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
Comenzando con TDatabase | Hola,
Logré solucionarlo con un mínimo cambio en el activate.
En lugar de:
[code=fw:3cmg6z5m]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">nowait</span> <span style="color: #0000ff;">valid</span> <span style="color: #000000;">(</span> oDbf:<span style="color: #000000;">close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> , .t.<span style="color: #000000;">)</span><br /> </div>[/code:3cmg6z5m]
Puse:
[code=fw:3cmg6z5m]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">nowait</span> <span style="color: #0000ff;">valid</span> oLbx:<span style="color: #000000;">lCloseArea</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:3cmg6z5m]
Y eso es todo. Funciona tal cual pretendía.
Saludos.
Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
Comenzando con xBROWSE | Despues de tantos golpes, active Xbrowse pero tengo el siguiente problema, estoy usando CDX, le agregue 3 registros manualmente con diferentes valores pero me muestra solo el ultimo registro repetidamente como si fueran iguales todos los registros, coloque oBrw:SetRDD()oBrw:Refresh( .t. )asi si veo los diferentes datos de los registros, pero me muestra todos los campos de la DBF con sus respectivos nombre en forma horizontal, si uso solo oBrw:Refresh( .t. ), me da un error de que no esta definido el bloque...le di vueltas pero no consegui resolver....alguna ayuda seria buena...gracias..y si alguien tiene algun ejemplo con las mayorias de las opciones del Xbrowse y oCol, no estaria de mas..dede ya ..GRACIAS... ya probe varios metodos y los identifique. <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
Comenzando con xBROWSE | Jose Luis,Por favor muéstranos el código donde creas el xbrowse, gracias |
Comenzando con xBROWSE | [quote="Antonio Linares":1mw735d8]Jose Luis,
Por favor muéstranos el código donde creas el xbrowse, gracias[/quote:1mw735d8]Antonio resuelto, fue un lapsu mental..esas cosas que pasan cuando estas trabajando a las 3am... habia puesto esto:oColInven:bStrData := { || ALLTRIM(oDbfInven:inv_codigo)}en ves de esto:oColInven:bStrData := { || ALLTRIM(jlinven->inv_codigo)}Gracias..! |
Comenzar aplicacion | Hola a todos, Solo quiero saber si existe algun ejemplo de como empezar desde 0 una aplicacion, para crear la ventana padre y luego las ventanas hijas, etc...Atentamente,Julio Ponce |
Comenzar aplicacion | Hola a todos, Solo quiero saber si existe algun ejemplo de como empezar desde 0 una aplicacion, para crear la ventana padre y luego las ventanas hijas, etc... Atentamente, Julio Ponce |
Comenzar aplicacion | jponce,Todos los que estamos aca hemos pasado por tu situacion , yo me tope con un curso que esta de la a la z muy intuitivo, ojala te sirva aqui pongo el enlace para que el que esta iniciando lo pueda descargar, <!-- m --><a class="postlink" href="http://www.box.net/shared/3r8bsmviso">http://www.box.net/shared/3r8bsmviso</a><!-- m -->Nota: el ejecutable se llama fivewin.exe y el te va guiando paso a paso, solo desempaquetalo y yasaludos desde managua, nicaragua,Ramon Paredes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.