• Welcome to Jose's Read Only Forum 2023.
 

Phonetic symbol into clipboard

Started by Aslan Babakhanov, October 18, 2013, 12:58:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aslan Babakhanov

This little utility (Phonetic symbol into clipboard) was written to help my mother in writing French language dictionary using MacOS 10.4 (PPC). Since QuarkXpress v6.25 doesn't have capability to paste unicoded phonetic symbols, I decided to write it using Purebasic.
At least, I found PB suitable for writing small/tiny applications for Mac OS. Pity, PB forms doesn't work under Mac...

; Paste text to the clipboard..
Define.s T, S
Define.i i,j
Dim ph.s(11)
ph(0)=Chr(Int($251))
ph(1)=Chr(Int($25B))
ph(2)=Chr(Int($259))
ph(3)=Chr(Int($26A))
ph(4)=Chr(Int($254))
ph(5)=Chr(Int($0F8))
ph(6)=Chr(Int($153))
ph(7)=Chr(Int($272))
ph(8)=Chr(Int($14B))
ph(9)=Chr(Int($283))
ph(10)=Chr(Int($265))
ph(11)=Chr(Int($292))

If OpenWindow(0,10,40,450,35,"PhonetiK", #PB_Window_SystemMenu)
  StickyWindow(0, 1)
  For i=0 To 11
    r = ButtonGadget(i,x+10,5,30,25, ph(i))
    x = x + 36
  Next 
  Repeat
    evt = WaitWindowEvent()
  Select evt
    Case #PB_Event_CloseWindow
      quit = 1
    Case #PB_Event_Gadget
      eg = EventGadget()
      If eg >=0 And eg <=11
        SetClipboardText (GetGadgetText(eg))
        DisableWindow (0, 1)
      EndIf
   EndSelect   
  Until quit = 1 
EndIf
End

; IDE Options = PureBasic 4.60 (MacOS X - PowerPC)
; CursorPosition = 48
; EnableUnicode
; EnableXP
; Executable = PhonetIKF.app
; Compiler = PureBasic 4.60 (MacOS X - PowerPC)