Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

urgent: problems with popup

Status
Not open for further replies.

rehanqadri

Programmer
Jan 31, 2004
40
PK
Problems with popup

i have to sovle some problems occuring in my project regarding popups. i am using popups to display the contents of stock item table so that my user can select items from their by pressing F2 key ( to display to popup). i am facing some problems. i would be very thankful if someone could solve my problem. i am listing down my problems.

1) When the popup is displayed and user pressess any key. fpw26 shows "insufficient memory" error.

2) when i display item_code and item_name from stock_item table it is displayed grable somewhat like this

SB Some item
SBC Some item
S Some item

i have used many logics but no logics but no logic worked for lining up the popup like the following

SB some item
SBC some item
s some item

3) i want to give my user a text box on top of popup so that user can filter items from the list.

4) how can i give headings like:

item_code item_name
_________ _________
SB some item
SBC some item
s some item


i will be very thankful i my above problems can be solved.

thank you
 
I'm afraid you are expecting way too much from FPW. You could fix all these problems by updating to VFP. The VFP 9.0 free public beta will be available in just a couple weeks (beggining of June).

1) Is simply a problem due to running under an OS that FPW was never tested under - while some have come up with workarounds that work in some cases, there is no universal answer. Consider reverting to Win 3.x.

2) Try using a fixed width font like Courier New.

3) Not really an option, unless you put the "popup" on a separate form that includes a textbox.

4) (see #3 above) You could use labels above a listbox.

Rick
 
Heres a function for testing memory

FUNCTION memcheck
PARAMETER m_parm

IF EMPTY(m_parm)
m_ar=.t.
m_ar=(VAL(SYS(1001))/10>VAL(SYS(1016)))
ELSE
m_ar=0
m_ar=VAL(SYS(1001))/10-VAL(SYS(1016))
ENDIF
RETURN m_ar

And some example code we used for list popups with title headers:

* --- Procedure av_list
PROCEDURE av_list
PRIVATE su_pos,;
su_title,;
su_refnum,;
j

su_title = "Code Item" &&&&& Your Popup Titles
j = 0
su_pos = 0
su_fred = 0
su_refnum ="A"
av_catnum = 1
av_cat =""

SELE <your table>
go top
IF .NOT. EOF()
SCAN FOR <Any filter or required value>
IF memcheck()
j = j + 1
DECLARE su_list[j,4]
su_list[j,1] = PADR(item_code,5)+PADR(item_name,35)
su_list[j,2] = item_code
su_list[j,3] = item_name
su_list[j,4] = ""

ENDIF
ENDSCAN
ELSE
su_list=""
ENDIF
IF EMPTY(su_list)
set filter to
return
ELSE
=ASORT(su_list,3,-1,1)
DEFINE WINDOW av_list;
FROM 02,00;
TO 14,73;
NONE NOFLOAT NOCLOSE NOGROW NOZOOM;
IN WINDOW <your window>;
COLOR SCHEME <your colours>

su_pos = 0

ACTIVATE WINDOW av_list

@ 00,02 SAY su_title COLOR (SCHEME(LISTBOX,5))
@ 01,00 GET su_pos FUNCTION "&T" FROM su_list SIZE 12,74 MESSAGE "Select the item you require from the list." COLOR SCHEME <your colours>

READ MODAL

su_fred=su_pos

RELEASE WINDOW av_list

ENDIF


RETURN

* --- End of Procedure av_list

Hope this is helpful (Used in Fox2.5 and fox2.6)

Bob Palmer
The most common solution is H2O!
 
Try these:
1) When the popup is..."insufficient memory" error.

Have you disabled the F2 ON KEY LABEL command when you activate the popup; pressing F2 again will try to activate the popup again and give you that "insufficient memory" error.

3..4)
Creating a screen that displays the items in a 'listbox' is probably your best solution; that way you can control the font, ie use a font like Courier to define your popup, use text fields over the listbox for headings and you can add the filter feature you want by adding a get field and maybe some buttons to the screen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top