Res /

Qinputbox Inc

Documentation

Resources

The Wiki

edit SideBar

Qinputbox Inc
'File source from Holyguard.net
'============

' QInputBox.inc

'============

'--- QInputBox.bas: <<-- This is the testing module for <QInputBox.inc>

'===========================================

'--- Purpose:

' This Control gives a useful method to querry user for an input

' while running the application. We often encounter that need.

' (C) Stanescu Serban, 2004, GNU-GPL (See http://www.gnu.org)

'==========================

Type QInputBox Extends QForm

Message As QEdit '--- Add the edit field

lblQuerry As QLabel '--- Add a label for our message

annullabtn as qbutton

OKBtn As qbutton '--- The button we need to

' close the window and pass the input value

'--- Redefine the OKBtn.OnClick Event to according to our purpose

event annullabtn.onclick
end
end event

EVENT OKBtn.OnClick

If QInputBox.Message.Text<>"" Then

QInputBox.close

Else

'--- Change the message according to the locales...

'---(EN)

ShowMessage "Inserire un Valore!!!"


End If

END EVENT

event onclose
If QInputBox.Message.Text="" Then end


end event

FUNCTION Input(Querry As String) As String

'--- Why doesn't this work?!!

'QInputBox.lblQuerry.Alignment=2 'taCenter '2

QInputBox.lblQuerry.Caption=" "+Querry

QInputBox.Message.Font.Bold=1


QInputBox.Showmodal

Result=QInputBox.Message.Text

QInputBox.Message.Text=""

END FUNCTION


CONSTRUCTOR

DelBorderIcons 1,2 '--- Minimize and Restore buttons
borderstyle=4
Height=150
width=400
Center

lblQuerry.Parent=QInputBox

lblQuerry.Autosize=0

lblQuerry.height=100

lblQuerry.Alignment=2 'taCenter

lblQuerry.Top=5

lblQuerry.Font.Bold=1

lblQuerry.LabelStyle=1

Message.Parent=QInputBox

Message.Left=5

OKBtn.Parent=QInputBox
annullabtn.parent=qinputbox


OKBtn.Top=QInputBox.ClientHeight-27
annullabtn.caption="Annulla"
annullabtn.Top=QInputBox.ClientHeight-27
annullabtn.left=315
okbtn.left=5

Message.Top=QInputBox.OKBtn.Top-27

'OKBtn.Left=QInputBox.clientWidth/2-OKBtn.Width/2

OKBtn.Font.Bold=1

lblQuerry.Width=QInputBox.ClientWidth-10

Message.Width=QInputBox.ClientWidth-10

OKBtn.Caption="O&K"

END CONSTRUCTOR

End Type

Recent Changes (All) | Edit SideBar Page last modified on August 17, 2007, at 11:33 AM Edit Page | Page History
Powered by PmWiki