I have a problem when using a combobox.
Here my prg file:
- Code: Select all Expand view
- #include "FiveWin.ch"
FUNCTION Main()
LOCAL aMwSt := { "19", "7", "0" }
LOCAL aTest := aPosArtEdit( aMwSt, "19" )
xbrowser( aTest )
RETURN( NIL )
FUNCTION aPosArtEdit( aMwSt, cPos )
LOCAL oDlg, oGet, cGet, oCbx, cCbx
LOCAL aItems := {}
LOCAL aRet := {}
XBROWSER aMwStSaetze TITLE "array given to function"
cGet := "Leistung xyz"
cCbx := padl( cPos, 2 ) + " %"
aeval( aMwSt, { | u | aadd( aItems, padl( u, 2 ) + " %" ) } )
XBROWSER aItems TITLE "array is now like this"
msginfo( "looking for cCbx = " + cCbx + CRLF + CRLF + "found on array position : " + str( ascan( aItems, cCbx ) ) )
DEFINE DIALOG oDlg NAME "EDIT_POS"
REDEFINE GET oGet VAR cGet ID 10 OF oDlg
REDEFINE COMBOBOX oCbx VAR cCbx ITEMS aItems ID 20 OF oDlg
REDEFINE BUTTON ID 30 OF oDlg ACTION ( aRet := { cGet, oCbx:nAt }, oDlg:End() )
ACTIVATE DIALOG oDlg
RETURN( aRet )
And here my rc file:
- Code: Select all Expand view
- #include <windows.h>
#include <commctrl.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
1 24 "WindowsXP.Manifest"
EDIT_POS DIALOG DISCARDABLE 6, 18, 322, 142
STYLE WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_VISIBLE
CAPTION "Define MwSt"
FONT 10, "MS Sans Serif"
{
CONTROL "Description", -1, "Static", WS_GROUP, 16, 28, 95, 8
CONTROL "", 10, "Edit", WS_BORDER|WS_TABSTOP, 16, 40, 248, 12
CONTROL "", 20, "ComboBox", WS_BORDER|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL|WS_TABSTOP, 16, 72, 48, 52
CONTROL "MwSt-Satz", -1, "Static", WS_GROUP, 16, 60, 40, 8
CONTROL "speichern", 30, "Button", WS_TABSTOP, 208, 116, 48, 14
}
I can't find out why the combobox is showing the array items in reverse order.
Does anyone know this behaviour?
-Detlef