I have set up a contextual click in a Listbox to copy the contents of a cell. I was thinking of giving some feedback to the user to show the item was copied, such as transient popup text that just says “Copied” and displays for maybe 1/2 second (500msec).
The only thing I could think of was a contextual menu popup with one item and set a timer to close the popup after a specified time (500msec).
Just wondering what others have done in this situation.
Create a canvas called MSG_COMPLETE
set it Visible=FALSE
in the PAINT EVENT put this code
#pragma Unused areas
Dim w As Integer
Dim h As Integer
If complete_text="" Then Exit Sub
g.TextFont="System"
g.TextSize=16
w=g.StringWidth(complete_text)+8
Me.height=g.stringheight(complete_text,w)+6
Me.Width=w+Me.height
//
h=g.height
w=g.width
g.ForeColor=&c3b3b3b
g.FillRoundRect 0,0,w,h,h,h
g.ForeColor=&caaaaaa
g.DrawRoundRect 0,0,w,h,h,h
g.ForeColor=color_white
w=(g.width-g.StringWidth(complete_text))\\2
g.DrawString complete_text,w,2+g.TextAscent
Create a GLOBAL string variable called COMPLETE_TEXT
Create a GLOBAL Method called TASK_COMPLETE as below [winMain is nameof window where MSG_COMPLETE is]
SUB TASK_COMPLETE(msg as string)
If msg<>"" Then
complete_text=msg
winMAIN.msg_complete.Visible=True
winMAIN.msg_complete.refresh
winMAIN.timer_complete.mode=timer.ModeSingle
winMAIN.msg_complete.Left=((winMAIN.width-winMAIN.msg_complete.width)\\2)
winMAIN.msg_complete.top=((winMAIN.height-winMAIN.msg_complete.height)\\3)
End If
Create a TIMER called timer_complete on same window as MSG_COMPLETE
in its ACTION event put
set the period to 1500
msg_complete.Visible=false
me.Mode=timer.ModeOff
To call just execute
Task_Complete "I am done doing the task you assigned"
it will appear as a rounded dark oval with the message centered, and automatically vanish 1.5 seconds later
I would maybe have a feedback area or bar at the top or bottom of an app to indicate an action took place. A popup every time someone does an activity would get annoying quick, IMO.