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 


Calc sx-10

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sat Oct 13, 2007 10:03 am    Post subject: Calc sx-10 Reply with quote

I have put some style on VDS calc... Wink

Code:
  OPTION DECIMALSEP,"."
  Title  Calc sx-10
  DIALOG CREATE,Calc sx-10,-1,0,136,205,COLOR $00808080,NOSYS
  DIALOG ADD,STYLE,Display,LCDMINI,10,BR,$00FF8080,$00804000
  DIALOG ADD,STYLE,STYLE1,Arial,,B
  DIALOG ADD,STYLE,STYLE2,,10,,,silver
  DIALOG ADD,EDIT,RES,24,10,115,20,0,,Display,READONLY
  DIALOG ADD,GRADIENT,GRADIENT1,0,0,0,0,silver,black,,HCENTERTOEDGES,FIT
  DIALOG ADD,SHAPE,LCDpower,5,10,78,15,$00310062,silver
  DIALOG ADD,TEXT,TEXT1,3,10,,,|    |    |    |    |    |,,TRANSPARENT,STYLE2
  DIALOG ADD,BUTTON,MC,50,10,25,19,,,,STYLE1
  DIALOG ADD,BUTTON,MR,50,40,25,19,,,,STYLE1
  DIALOG ADD,BUTTON,MA,50,70,25,19,M+,,,,STYLE1
  DIALOG ADD,BUTTON,C,50,100,25,25,C
  DIALOG ADD,BUTTON,N7,80,10,25,25,7
  DIALOG ADD,BUTTON,N8,80,40,25,25,8
  DIALOG ADD,BUTTON,N9,80,70,25,25,9
  DIALOG ADD,BUTTON,FD,80,100,25,25,/
  DIALOG ADD,BUTTON,N4,110,10,25,25,4
  DIALOG ADD,BUTTON,N5,110,40,25,25,5
  DIALOG ADD,BUTTON,N6,110,70,25,25,6
  DIALOG ADD,BUTTON,FX,110,100,25,25,*
  DIALOG ADD,BUTTON,N1,140,10,25,25,1
  DIALOG ADD,BUTTON,N2,140,40,25,25,2
  DIALOG ADD,BUTTON,N3,140,70,25,25,3
  DIALOG ADD,BUTTON,FM,140,100,25,25,-
  DIALOG ADD,BUTTON,N0,170,10,25,25,0
  DIALOG ADD,BUTTON,NZ,170,40,25,25,.
  DIALOG ADD,BUTTON,FE,170,70,25,25,=
  DIALOG ADD,BUTTON,FP,170,100,25,25,+
  DIALOG ADD,BUTTON,Off,3,95,30,19
  DIALOG SHOW
  DIALOG SET,Res,1
  %R = 0
  %M = 0
  %O =
  goto UPDATE
 
:Loop
  wait event
  if @equal(%R,0)
    %R =
  end
  %E = @event()
  %K = @substr(%E,2,2)
  if @equal(%K,Z)
    %R = %R.
    goto UPDATE
  end
  if @greater(@pos(%K,0123456789),0)
    %R = %R%K
    goto UPDATE
  end
  if @greater(@pos(%K,PMDXE),0)
    gosub OPERATE
    if @equal(%K,E)
      %O =
    else
      %O = %K
    end
    goto Loop
  end
  goto %E
:CLOSE
  exit
:CBUTTON
  %R = 0
  %P = 0
  %O =
  goto UPDATE
:MCBUTTON
  %M = 0
  goto Loop
:MABUTTON
  if %R
    %M = @fadd(%M,%R)
  else
    %M = @fadd(%M,%P)
  end
  goto Loop
:MRBUTTON
  %R = %M
:UPDATE
  dialog set,RES,%R
  goto Loop
:OffButton
 goto close
:OPERATE
  if %R
    if @equal(%O,P)
      %P = @fadd(%P,%R)
    end
    if @equal(%O,M)
      %P = @fsub(%P,%R)
    end
    if @equal(%O,D)
      %P = @fdiv(%P,%R)
    end
    if @equal(%O,X)
      %P = @fmul(%P,%R)
    end
    if @null(%O)
      %P = %R
    end
  end
  %R =
  dialog set,RES,%P
  exit





I can't put numbers to the right side of the edit ?



Calc.zip
 Description:
Update to final version...Calc sx-13

From original VDS Calc.dsc:
Design was styleized
Remove ALT key support
Flashing cursor also gone
EDIT replace with TEXT to get right align (Garrett 's TIP) you can't use Copy/Paste anymore that's a shame.

Download
 Filename:  Calc.zip
 Filesize:  10.78 KB
 Downloaded:  671 Time(s)



Last edited by filip on Sat Oct 13, 2007 8:34 pm; edited 7 times in total
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2146
Location: A House

PostPosted: Sat Oct 13, 2007 6:56 pm    Post subject: Reply with quote

Wow, I thought the justification attribute worked on EDIT boxes... Seems not though. Sad

I did try also spin and list and neither took the right justification either.

What you can do is put a transparent text element over the edit box and simply use that text element instead of the edit box. The text element does accept the right justification.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
http://www.freewarehome.com <-- Freeware listings since 1996
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sat Oct 13, 2007 7:58 pm    Post subject: Reply with quote

NICE... Very Happy

Garrett is a good lad Wave

Final version... Cool

Code:
  OPTION DECIMALSEP,"."
  Title  Calc sx-13
  DIALOG CREATE,Calc sx-13,-1,0,136,205,COLOR $00808080,NOSYS
  DIALOG ADD,GRADIENT,GRADIENT1,0,0,0,0,silver,black,,HCENTERTOEDGES,FIT
  DIALOG ADD,STYLE,Display,LCDMINI,10,BR,$00FF8080,$00804000
  DIALOG ADD,SHAPE,LCDpower,5,10,78,15,$00310062,silver
  DIALOG ADD,SHAPE,LCDpower1,26,10,115,18,$00FF8080,silver
  DIALOG ADD,STYLE,STYLE1,Arial,,B
  DIALOG ADD,STYLE,STYLE2,,10,,,silver
  DIALOG ADD,TEXT,RES,27,118,,,,,TRANSPARENT,Display
  DIALOG ADD,TEXT,TEXT1,3,10,,,|    |    |    |    |    |,,TRANSPARENT,STYLE2
  DIALOG ADD,BUTTON,MC,50,10,25,19,,,,STYLE1
  DIALOG ADD,BUTTON,MR,50,40,25,19,,,,STYLE1
  DIALOG ADD,BUTTON,MA,50,70,25,19,M+,,,,STYLE1
  DIALOG ADD,BUTTON,C,50,100,25,25,C
  DIALOG ADD,BUTTON,N7,80,10,25,25,7
  DIALOG ADD,BUTTON,N8,80,40,25,25,8
  DIALOG ADD,BUTTON,N9,80,70,25,25,9
  DIALOG ADD,BUTTON,FD,80,100,25,25,/
  DIALOG ADD,BUTTON,N4,110,10,25,25,4
  DIALOG ADD,BUTTON,N5,110,40,25,25,5
  DIALOG ADD,BUTTON,N6,110,70,25,25,6
  DIALOG ADD,BUTTON,FX,110,100,25,25,*
  DIALOG ADD,BUTTON,N1,140,10,25,25,1
  DIALOG ADD,BUTTON,N2,140,40,25,25,2
  DIALOG ADD,BUTTON,N3,140,70,25,25,3
  DIALOG ADD,BUTTON,FM,140,100,25,25,-
  DIALOG ADD,BUTTON,N0,170,10,25,25,0
  DIALOG ADD,BUTTON,NZ,170,40,25,25,.
  DIALOG ADD,BUTTON,FE,170,70,25,25,=
  DIALOG ADD,BUTTON,FP,170,100,25,25,+
  DIALOG ADD,BUTTON,Off,3,95,30,19
  DIALOG SHOW
  DIALOG SET,Res,1
  %R = 0
  %M = 0
  %O =
  goto UPDATE
 
:Loop
  wait event
  if @equal(%R,0)
    %R =
  end
  %E = @event()
  %K = @substr(%E,2,2)
  if @equal(%K,Z)
    %R = %R.
    goto UPDATE
  end
  if @greater(@pos(%K,0123456789),0)
    %R = %R%K
    goto UPDATE
  end
  if @greater(@pos(%K,PMDXE),0)
    gosub OPERATE
    if @equal(%K,E)
      %O =
    else
      %O = %K
    end
    goto Loop
  end
  goto %E
:CLOSE
  exit
:CBUTTON
  %R = 0
  %P = 0
  %O =
  goto UPDATE
:MCBUTTON
  %M = 0
  goto Loop
:MABUTTON
  if %R
    %M = @fadd(%M,%R)
  else
    %M = @fadd(%M,%P)
  end
  goto Loop
:MRBUTTON
  %R = %M
:UPDATE
  dialog set,RES,%R
  goto Loop
:OffButton
 goto close
:OPERATE
  if %R
    if @equal(%O,P)
      %P = @fadd(%P,%R)
    end
    if @equal(%O,M)
      %P = @fsub(%P,%R)
    end
    if @equal(%O,D)
      %P = @fdiv(%P,%R)
    end
    if @equal(%O,X)
      %P = @fmul(%P,%R)
    end
    if @null(%O)
      %P = %R
    end
  end
  %R =
  dialog set,RES,%P
  exit
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Page 1 of 1

 
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