forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Image inside Edit Box.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Oct 27, 2003 1:28 pm    Post subject: Image inside Edit Box. Reply with quote

Is there a way to have an image inside an edit box? I have seen a lot of apps that have this that work on Win 9X and NT boxes.

Like this:



Thanks

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Oct 27, 2003 3:38 pm    Post subject: Reply with quote

Maybe be adding opacity to the edit box with some code Codescript made a little while ago?

http://forum.vdsworld.com/viewtopic.php?t=1693

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Mon Oct 27, 2003 6:36 pm    Post subject: Reply with quote

Layered window attributes can be set only to parent window.
The effect in the screenshot LiquidCode has posted can be achieved only by subclassing the edit control and handling it's paint events and drawing the pitcure after that (backgound) - needs a dll. I don't know any other way to achieve that. Sad

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Oct 27, 2003 7:24 pm    Post subject: Reply with quote

Doh! Ok. Well thanks anyway.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Oct 27, 2003 8:40 pm    Post subject: Reply with quote

You could always simulate an edit box... I think Skit posted some
code to do that once... basically you have to have the off-screen
edit box in focus, and take whatever is typed in there and set
the text element or whatever to the text of the edit box. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Oct 28, 2003 1:22 am    Post subject: Reply with quote

Yeah, I might do that. Good idea. Wink
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Oct 28, 2003 2:27 pm    Post subject: Reply with quote

This should work too. I only can't get the last three API lines to work if I first set the parent of the edit box, and vice-versa.... Confused Maybe somebody can take a look at it? Smile

Code:
#define command,Stick-a-window

  DIALOG CREATE,Test Dialog,-1,0,240,160
  DIALOG ADD,GRADIENT,GRADIENT1,0,0,240,160,NAVY,BLUE,,BOTTOMTOTOP
  DIALOG SHOW

  DIALOG CREATE,Just an editbox,-1,0,180,20,NOTITLE,INVISIBLE
  DIALOG ADD,EDIT,EDIT1,0,0,180,20,EDIT1
  DIALOG SHOW

rem Usage:
rem Stick-a-window "Windowname",top,left,opacity,dialog number of main window...
Stick-a-window "Just an editbox",10,10,150,0

wait event

exit

rem -------------------------------
rem Include this in your scripts...
rem -------------------------------

:Stick-a-window

  loadlib user32
 
  rem Get the handle of the window
  %%hWnd = @strdel(@winexists(%1),1,1)

  rem Select the main window so you can get the handle of it...
  dialog select,%5

  rem Assign the 'child' window to his 'parent' (the edit box to the main window)...
  %%Temp = @lib(user32,SetParent,INT:,%%hWnd,@strdel(@winexists(@dlgtext()),1,1))
 
  rem Set the new position of the 'child' window...
  window position,"%"%%hWnd,%2,%3
 
  rem With these three lines, set the opacity...
  %%Temp = @lib(user32,GetWindowLongA,INT:,%%hWnd,-20)
  %%Temp = @lib(user32,SetWindowLongA,INT:,%%hWnd,-20,@sum($80000,$80))
  %%Temp = @lib(user32,SetLayeredWindowAttributes,INT:,%%hWnd,0,%4,$2)
 
  freelib user32
 
  exit

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Oct 28, 2003 2:34 pm    Post subject: Reply with quote

That only works in Win XP and 2K right?
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Oct 28, 2003 2:46 pm    Post subject: Reply with quote

Yeah it works only win 2k+ and once U make window a child window sytem will ignore/remove the Layered window attributes.
Hi LiquidCode
I think it's possible to make a RTF box transparent 9x too (will try) - though you need vdsug or gadget dll till the VDS update.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Oct 28, 2003 3:31 pm    Post subject: Reply with quote

Here is some easy code to simulate an edit box. You can change it however you like... Smile

Code:
%%Bitmap = @windir()\explorer.exe

  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,EDIT,EDIT1,-100,32,180,19
  DIALOG ADD,SHAPE,EDIT1SHAPE,69,31,180,19,WHITE,BLACK,,RECTANGLE,CLICK
  DIALOG ADD,BITMAP,EDIT1BITMAP,70,32,178,17,%%Bitmap,,CLICK
  DIALOG ADD,TEXT,EDIT1TEXT,72,34,,,,,CLICK,TRANSPARENT
  DIALOG ADD,BUTTON,BUTTON1,104,146,64,24,BUTTON1
  DIALOG SHOW

:Evloop
wait event,0.0001
goto @event()

:Timer
if @equal(@focus(),EDIT1)
  dialog set,Edit1Text,@dlgtext(Edit1)
  if @equal(@winactive(I),@winexists(@dlgtext()))
    window send,~EDIT1,@key(end)
    end
  end
goto Evloop

:Edit1ShapeCLICK
:Edit1BitmapCLICK
:Edit1TextCLICK
dialog focus,Edit1
dialog set,Edit1Text,@dlgtext(Edit1)
goto Evloop

:Button1button
info Here is your text! @cr()@cr()@chr(34)@dlgtext(Edit1)@chr(34)
goto Evloop

:Close
exit

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Oct 28, 2003 4:47 pm    Post subject: Reply with quote

Hey CodeScript. That would be great thanks!

Thanks for the code Skit.

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Oct 28, 2003 6:16 pm    Post subject: Reply with quote

Hi LiquidCode
Is this what U want ?
A transparent multiline RichEdit box



Try this:
http://codescript.vdsworld.com/VDS5src/TranparentRichedit.zip

You can modify the style of Richedit further as per your wish.
I hope this be possible in pure VDS after the update.

The dll may crash under XP/2k in VDS 5.x (it works VDS 3.x and above)
if that happens replace the dll mousedown with buggy Wink VDS mousedown.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Oct 28, 2003 7:17 pm    Post subject: Reply with quote

That's real cool! Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Oct 28, 2003 8:04 pm    Post subject: Reply with quote

I posted that I couldn't get it to work....then it started to work.. Confused Anyway, great job!!! Thanks much! I do hope that with the update this can be used without a dll.

Thanks again!!! Very Happy

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Oct 28, 2003 8:05 pm    Post subject: Reply with quote

It crashed. Sad I have to reboot...
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group