Source language: Translate to:

How can I drag and drop a large object group at runtime?

General questions about NeoBook

Moderator: Neosoft Support

How can I drag and drop a large object group at runtime?

Postby Enigman » Wed Sep 03, 2014 10:55 am

As I mentioned in previous posts, I am working on a virtual keyboard for a program. I want it to work so that I open the Vkeyboard on screen, then click the cursor into a text box I want to edit, then press keys on the virtual keyboard which are then inserted into the text box.

If I open the keyboard as a CustomWindow, then the second I press a key on the Vkeyboard, the text box is unfocused and the CustomWindow has the focus. That means I cannot get the text box with the focus or the cursor position in the text box. This means that instead of using a CustomWindow, I must display the keyboard as an object that I set as visible when needed. That works fine and the text box retains its focus when I press keys on the Vkeyboard.

The down side is that the Vkeyboard is fixed on the screen and overlaps many of the text boxes. I know I can use buttons to reposition the Vkeyboard in one-shot jumps, but Ideally, I would like to be able to drag the Vkeyboard around the screen and drop it where I want. I have searched the forum and the help file and I have not found a good way to do this with a large assembly of objects in a group.

Has anyone done this?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: How can I drag and drop a large object group at runtime?

Postby Garic » Wed Sep 03, 2014 4:27 pm

Look this example how to move objects the mouse:
http://rghost.ru/57839889
ks
.............
Image
User avatar
Garic
 
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: How can I drag and drop a large object group at runtime?

Postby Enigman » Wed Sep 03, 2014 5:21 pm

Look this example how to move objects the mouse:
http://rghost.ru/57839889

Thank you for replying. I'm sure the intention is good, buuuuut ... that link goes to a page with no identification other than a download link. I make it a policy to avoid such pages. There is no way for me to know what I am downloading.

I am more interested in a dialog about how to do this with a readable explanation.

Thanks anyway. :)
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: How can I drag and drop a large object group at runtime?

Postby dpayer » Wed Sep 03, 2014 5:36 pm

Garic wrote:Look this example how to move objects the mouse:
http://rghost.ru/57839889


I did download the pub. I appears we need to have a plugin installed (zmfunctions?) for the demo to work.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: How can I drag and drop a large object group at runtime?

Postby Garic » Wed Sep 03, 2014 5:54 pm

Yes, I have forgotten to mention, that the plug-in zmfunctions is required.
Russian variant can be downloaded from here:
http://neobooker.ru/forum/37-1610-1
ks
.............
Image
User avatar
Garic
 
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: How can I drag and drop a large object group at runtime?

Postby virger » Wed Sep 03, 2014 7:09 pm

It got me thinking and I came this. I hope it will help solve your doubt

Code: Select all
NBW Publication Source File
(C)2014 NeoSoft Corp.
Title=My Virtual KeyBoard
Language=US
NeoBookVer=5.80
ScreenColors=16777216
ScreenWidth=330
ScreenHeight=400
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=95
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
SubroutineAction=:pKey¶SetObjectFill "[Self]" "120,224,0" "Solid" "False"¶FocusObject "EnText"¶if "[Self]" "=" "Space"¶    SendKeys "" "[#32]"¶else¶    SendKeys "" "[Self]"¶endif¶FocusObject "vKey"¶SetObjectFill "[Self]" "184,240,248" "Solid" "False"¶Return
ShapeTransColor=536870912
SplashProps=3
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
ReqExLevel=1
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
MenuBegin
MenuName=WinText
MenuText=F5...ShowText
MenuState=3
MenuKey=116
MenuAction=if "[fWinTx]" "=" "T"¶    setvar "[fWinTx]" ""¶    GetObjectInfo "EnText" "Left" "[PsTexX]"¶    GetObjectInfo "EnText" "Top"  "[PsTexY]"¶    SetObjectFill "EnText" "248,240,240" "Solid" "False"¶    CloseCustomWindow "EnText"¶else¶    setvar "[fWinTx]" "T"¶    SetObjectFill "EnText" "216,248,224" "Solid" "False"¶    CustomWindow "Current Text" "[PsTexX]" "[PsTexY]" "EnText" "DialogBox+NoCloseBtn"¶endif
MenuName=WinKey
MenuText=F12...KeyBoard
MenuState=3
MenuKey=123
MenuAction=if "[fWinKy]" "=" "T"¶    setvar "[fWinKy]" ""¶    DisableObject "vKey"¶    GetObjectInfo "vKey" "Left" "[PsKeyX]"¶    GetObjectInfo "vKey" "Top"  "[PsKeyY]"¶    CloseCustomWindow "vKey"¶else¶    setvar "[fWinKy]" "T"¶    EnableObject "vKey"¶    CustomWindow "Virtual KeyBoard" "[PsKeyX]" "[PsKeyY]" "vKey" "DialogBox+NoCloseBtn"¶endif
MenuName=Exit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=exit "" ""
MenuEnd
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
MasterPage
NewPage=New Page
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
EffectSpeed=0
PgEnterAction=setvar "[PsKeyX]" "190"¶setvar "[PsKeyY]" "150"¶¶setvar "[PsTexX]" "0"¶setvar "[PsTexY]" "0"¶¶FileExists "[PubDir]KeyBoard.gif" "[Sn]"¶if "[Sn]" "=" "False"¶    ShowObject "BtDownload" "None" "0"¶endif
ObjectType=9
Name=EnText
X=5
Y=0
W=320
H=400
Anchor=0
VarName=[Tx]
Align=1
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=15790328
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=21
Name=vKey
X=-905
Y=14
W=638
H=361
Anchor=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=15790328
FillPattern=0
TabOrder=2
HMargin=0
VMargin=0
ContainerBegin
ObjectType=4
Name=PicKeyboard
X=0
Y=0
W=625
H=300
Anchor=0
Locked=Yes
FileName=[PubDir]KeyBoard.gif
PictStyle=0
PictTransColor=50331647
Centered=Yes
Resample=Yes
LineColor=0
LineWidth=0
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=0
ObjectType=3
Name=H
X=285
Y=172
W=30
H=30
Anchor=0
Text=H
Align=2
Key=72
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=3
Name=U
X=316
Y=132
W=30
H=30
Anchor=0
Text=U
Align=2
Key=85
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6
ObjectType=3
Name=L
X=405
Y=171
W=30
H=30
Anchor=0
Text=L
Align=2
Key=76
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
FillMode=Yes
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=11
ObjectType=3
Name=A
X=86
Y=172
W=30
H=30
Anchor=0
Text=A
Align=2
Key=65
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
FillMode=Yes
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=3
Name=P
X=436
Y=132
W=30
H=30
Anchor=0
Text=P
Align=2
Key=80
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=10
ObjectType=3
Name=R
X=195
Y=132
W=30
H=30
Anchor=0
Text=R
Align=2
Key=82
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=7
ObjectType=3
Name=V
X=226
Y=211
W=30
H=30
Anchor=0
Text=V
Align=2
Key=86
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=3
Name=I
X=356
Y=132
W=30
H=30
Anchor=0
Text=I
Align=2
Key=73
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=3
Name=D
X=165
Y=171
W=30
H=30
Anchor=0
Text=D
Align=2
Key=68
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=3
Name=O
X=396
Y=131
W=30
H=30
Anchor=0
Locked=Yes
Text=O
Align=2
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=9
ObjectType=3
Name=Space
X=175
Y=251
W=228
H=30
Anchor=0
Align=2
Key=32
ImageStyle=0
BevelWidth=0
ObjAction=gosub "pKey"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=8
ContainerEnd
ObjectType=3
Name=BtDownload
X=97
Y=68
W=133
H=28
Anchor=0
Text=DownLoad "Pic"
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=FileExists "[PubDir]KeyBoard.gif" "[Sn]"¶if "[Sn]" "=" "False"¶    DownloadFile "http://www.internet4classrooms.com/images/winkeyboard-leftside.gif" "[PubDir]keyboard.gif" "HideProgress+Async"¶.http://www.internet4classrooms.com/images/winkeyboard-leftside.gif¶endif¶moveobject "[Self]" "-100" "0"¶hideobject "[Self]" "" ""¶RefreshObject "PicKeyboard"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16314584
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
Visible=No
TabOrder=4
ObjectType=3
Name=BtDemo
X=99
Y=13
W=128
H=34
Anchor=0
Text=Press Me !
Align=2
ImageStyle=0
BevelWidth=0
ObjAction=hideobject "BtDemo" "" ""¶delay "500"¶EnableObject "vKey"¶CustomWindow "Virtual KeyBoard" "[PsKeyX]" "[PsKeyY]" "vKey" "DialogBox+NoCloseBtn"¶¶GetObjectInfo "vKey" "Left" "[PsKX]"¶GetObjectInfo "vKey" "Top"  "[PsKY]"¶strparse "H.O.L.A.Space.P.U.R.A.Space.V.I.D.A." "." "[Lt]" "[nLet]"¶loop "1" "[nLet]" "[C]"¶    GetObjectInfo "[Lt[c]]" "Left" "[PsX]"¶    GetObjectInfo "[Lt[c]]" "Top"  "[PsY]"¶    SetMousePos "[PsKX]+[PsX]+25" "[PsKY]+[PsY]+40"¶    SetObjectFill "[Lt[c]]" "248,144,0" "Solid" "False"¶    ClickMouse¶    delay "600"¶    SetObjectFill "[Lt[c]]" "184,240,248" "Solid" "False"¶endloop¶delay "3000"¶CloseCustomWindow "vKey"¶setvar "[Tx]" ""
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16314552
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5


SOMOS PURA VIDA
COSTA RICA
SOMOS LEYENDA
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: How can I drag and drop a large object group at runtime?

Postby Enigman » Wed Sep 03, 2014 8:44 pm

Okay, thanks. But, your keyboard is in a "window". As I mentioned above, I cannot use a window because it takes the focus away from the text boxes on the main screen.

My question is in reference to dragging an object group across the screen, not a window that is already a floating panel.

Thanks for your sample.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: How can I drag and drop a large object group at runtime?

Postby mishem » Wed Sep 03, 2014 9:28 pm

In order to make your venture, you need a plugin to monitor global mouse. I do not know this today. They do not work well.

If there is a plugin, you can easily do it.
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron