Bullets on Windows...

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Bullets on Windows...

Post by Dixie » Sat Aug 08, 2009 10:33 am

Good morning...

I have a script that puts bullets into a field I am using to hide the charecters of a password that is typed in by a user. Under Mac OS the bullet is produced by the shift-option-8 key combination... this works well under Windows too... until, I make the stack a standalone and then I get vertical straight lines not bullets...

If someone could tell me which font to use, I would appreciate it.

Code: Select all

on keyDown theKey
      put empty into fld "passresponse"
      put "•" after fld 2
      put theKey after fld 3
end keyDown

on backSpaceKey
   if the selection of me is not empty then
      delete the selection
      put the text of me into fld 3
      exit backSpaceKey
   end if
   delete the last char of fld 2
   delete the last char of fld 3
end backSpaceKey

on returnInField
   send "mouseUp" to button "signIn"
end returnInField

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Aug 08, 2009 11:50 am

Hi Dixie,

the bullet point should be available in most win fonts, but most of the characters with ASCII values > 127 are not getting translated correctly.
Like the EURO sign and the bulletpoint

I use a function in my projects which works fine:

Code: Select all

function bullet_point
  if the platform = "MacOS" then
    return numtochar(165)
  else
    return numtochar(183)
  end if
end bullet_point
Hope that helps.


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Sat Aug 08, 2009 12:14 pm

Hi Dixie,

I think Klaus's solution is the best but if you want to have complete control over the bullet you can make an image lets say 8 by 8 pixels then take the brush tool with the smallest diameter for point and click at the image. Then you look up the id of the image in the inspector.

your code would be:

Code: Select all

on keyDown theKey 
   put empty into fld "passresponse"
   lock screen
   put "•" after fld 2 -- or any other character
   set the imagesource of last char of me to 1015 -- or whatever the id of your bullet image is
   put theKey after fld 3 
end keyDown 
this way the bullet character is replaced by the image of the bullet.

Just another way of doing it.

regards
Bernd

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Post by Dixie » Sat Aug 08, 2009 12:44 pm

Thanks for the quick relplies... Klaus and Bernd

I went for the solution that Klaus proposed... the cat is happy... I shall stop kicking it now.

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Aug 08, 2009 1:33 pm

Dixie wrote:Thanks for the quick relplies... Klaus and Bernd

I went for the solution that Klaus proposed... the cat is happy... I shall stop kicking it now.
Atta boy :)

Post Reply