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 


A better character map
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jan 03, 2003 8:10 am    Post subject: Reply with quote

the reason why these 2 lines are remmed is because the timer code that cnodnarb gave me was in the vds 3.x code and i wanted to check that i could implement the same changes into the vds 4.x code before deleting these 2 lines...and then i forgot to delete them when i found that i had implemented the code ok.

Interesting comment dr dread, the code works fine on my ME system - may be under xp or w2k, the api codes returned are different.

Would you like me to return the code to what i had as that involved no api calls and it should work just fine...

Pity it doesn't work because cnodnarb idea was great in that you could "press" the up button and see the character move up - as opposed to repeatedly clicking it.

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Jan 03, 2003 9:25 am    Post subject: Reply with quote

Perhaps you could do something like this instead, if API return codes are different on various systems:

Code:

  %%check = @sendmsg(@win(~up_button),$0F2,0,0)
  if @not(@equal(%%check,0))
      dialog setpos,text1,@fsub(@dlgpos(text1,t),2),,,
  end


Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jan 03, 2003 9:43 am    Post subject: Reply with quote

Interesting idea dr dread but as soon as i click on the up button, it starts moving up and i can't stop it anymore - may be it needs a bit of refining...

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Jan 03, 2003 9:55 am    Post subject: Reply with quote

How about this one then:

Code:

  %%check = @sendmsg(@win(~up_button),$0F2,0,0)
  if @both(@not(@equal(%%check,0)),@not(@equal(%%check,8)))
      dialog setpos,text1,@fsub(@dlgpos(text1,t),2),,,
  end


Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jan 03, 2003 1:18 pm    Post subject: Reply with quote

well done, dr dread! this one works fine...except that...when you do a single click, it sometimes does not move up or down...but...otherwise it works just great Very Happy Very Happy Very Happy

i've included the amended code below,

Code:

%%title = >A Better Character Map
%%version = 1.00
%%date = January 2003
option scale, 96
option decimalsep,"."

Title %%title %%version, Copyright Serge M Botans %%date
  DIALOG CREATE,%%title %%version,-1,0,700,540
  DIALOG ADD,STATUS,STATUS1,
  DIALOG ADD,LIST,LIST1,10,10,160,500,Font List,CLICK,SORTED
  DIALOG ADD,LIST,LIST2,10,180,25,500,Font Size,CLICK
  DIALOG ADD,BUTTON,UP_BUTTON,440,485,90,30,Move &Up
  DIALOG ADD,BUTTON,DOWN_BUTTON,480,485,90,30,Move &Down
  DIALOG ADD,BUTTON,CANCEL,440,605,90,30,&Quit
  DIALOG ADD,TEXT,ABOUT_T,488,635,60,20,About,,HAND,CLICK
   
  rem === lists the fonts in the windows font folder ===
  if @equal(@name(@sysinfo(winver)),5)
      LIST REGVALS,list1,LOCAL,Software\Microsoft\Windows NT\CurrentVersion\Fonts
  elsif @equal(@name(@sysinfo(winver)),4)
      LIST REGVALS,list1,LOCAL,Software\Microsoft\Windows\CurrentVersion\Fonts
  end 
 
  rem === removes things like (true type) from listing
  %i = 0
  repeat
      list seek, list1, %i
    %%dummy = @item(list1)
    %%dummy = @substr(%%dummy,1,@fsub(@pos((,%%dummy),1))
    list put, list1, %%dummy
    %i = @succ(%i)
  until @equal(%i,@count(list1))
 
  rem === adds font size to list 2 ===
  %i = 6
  repeat
      list add, list2, %i
    %i = @succ(%i)
  until @equal(%i,44)
 
  rem === displays first font on list and completes the display of the interface ===
  list seek, list1, 0
  list seek, list2, 10
  dialog add,style,style1,@item(list1),16
  dialog add,style,styles1,@item(list1),60
  dialog set, status1, Current Font is @item(list1)
  %%style_index = 1
  %%start = yes
  dialog disable, up_button
  dialog disable, down_button
  gosub draw_buttonsSUB
  dialog show
  %%start = no
 
:timer
  %%check = @sendmsg(@win(~up_button),$0F2,0,0)
  if @both(@not(@equal(%%check,0)),@not(@equal(%%check,8)))
      dialog setpos,text1,@fsub(@dlgpos(text1,t),2),,,
  end
 
  %%check = @sendmsg(@win(~down_button),$0F2,0,0)
  if @both(@not(@equal(%%check,0)),@not(@equal(%%check,8)))
      dialog setpos,text1,@fadd(@dlgpos(text1,t),2),,,
  end
 
:evloop
  wait event,.1
  %%event = @event()
  if @greater(@pos(up,%%event),0)   
      goto %%event
  elsif @greater(@pos(down,%%event),0)
      goto %%event
  elsif @greater(@pos(cancel,%%event),0)
    goto %%event
  elsif @greater(@pos(button,%%event),0)
      %%dummy = @strdel(%%event,1,6)
    %%dummy = @substr(%%dummy,1,@fsub(@pos(button,%%dummy),1))
    if @equal(%%dummy,38)
       dialog set, text1, &&
    else
       dialog set, text1, @chr(%%dummy)
    end
    dialog set, status1, Current Font is @item(list1) <> This is CHR(%%dummy) <> @chr(%%DUMMY) has been copied to the clipboard.
    clipboard set, @chr(%%dummy)
    %%move_flag = yes
    dialog enable, up_button
    dialog enable, down_button
  else
      goto %%event
  end
  goto evloop

:list2CLICK
:list1CLICK
  %%style_index = @succ(%%style_index)
  dialog disable, up_button
  dialog disable, down_button
  dialog add,style,style%%style_index,@item(list1),@item(list2)
  dialog add,style,styles%%style_index,@item(list1),60
  clipboard clear
  dialog set,text1,
  dialog set, status1, Current Font is @item(list1)
  gosub draw_buttonsSUB
  goto evloop 
 
:up_buttonBUTTON
  rem dialog setpos,text1,@fsub(@dlgpos(text1,t),2),,,
  goto evloop

:down_buttonBUTTON
  rem dialog setpos,text1,@fadd(@dlgpos(text1,t),2),,,
  goto evloop
 
:about_tCLICK
  %%about_1 = This program is free for you to use.
  %%about_2 = E-Mail: sergeb"@"alphalink.com.au@CR()@CR()Web Site: www.alphalink.com.au/~sergeb
  %%about_3 = Copyright Serge M Botans@CR()Melbourne Australia@CR()%%date@CR()All Rights Reserved
  info %%about_1@CR()@CR()%%about_2@CR()@CR()%%about_3
  goto evloop
 
:Close
:cancelBUTTON
  exit

:draw_buttonsSUB
  rem === draws the buttons ===
  %j = 2
  %%y_position = 10
  repeat
  %i = 1
  %%x_position = 185
        repeat
            %%x_position = @fadd(%%x_position,30)
            %%button_index = @fadd(@fmul(%j,16),%i)
            if @equal(%%start,no)
                 dialog remove, button%%button_index
            end
               DIALOG ADD,BUTTON,BUTTON%%button_index,%%y_position,%%x_position,30,30,@chr(@fadd(@fmul(%j,16),%i)),,style%%style_index
               if @equal(%%button_index,38)
                 dialog set, button38, &&
            end
            %i = @succ(%i)
        until @equal(%i,17)
  %%y_position = @fadd(%%y_position,30)
  %j = @succ(%j)
  until @equal(%j,16)
  dialog set, button256,
  dialog disable, button256
 
 
  if @equal(%%start,no)
     dialog remove, text1
  end
  dialog add,text,text1,430,390,100,100,,,styles%%style_index
  exit



Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Fri Jan 03, 2003 1:46 pm    Post subject: Reply with quote

How about adding the ability to click on the character and it will also show the @chr() (VDS Code) for it !

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Fri Jan 03, 2003 2:22 pm    Post subject: Reply with quote

Thanx Dr. Dread!! I have to go update a few projects now Embarassed

NodNarb
Back to top
View user's profile Send private message AIM Address
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jan 03, 2003 10:22 pm    Post subject: Reply with quote

Hi Rubes_sw,

the @chr() value of a character is displayed in the status bar when you click on it (it is displayed as CHR() ) - and as an added feature, the character is itself automatically also copied to the clipboard when you click on it.

Is that what you were after - the CHR() bit in the status bar?

Serge

ps feel free to change to code to suit your needs if you want to...

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Goto page Previous  1, 2
Page 2 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