EASIER POPUP dialog with rsc..using tos 1.0

GFA BASIC-related articles in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2058
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

EASIER POPUP dialog with rsc..using tos 1.0

Postby charles » Sun Sep 24, 2017 7:11 pm

im integrating a popup dialog made with a rsc editor.
is there an easier method to handle the dialog ?
been using form_do()
but actionary ,if my popup covers a higher numbered obj in the form ,form_do() seems to seize up instead of
relase its finding

included is my demo

Code: Select all

' sof
'
SAVE "b:\rscpop1.gfa"
LIST "b:\rscpop1.lst"
'
' *** constant and variables
a%=0
a&=0
tree&=0
rsc_adr%=0
a$=""
b$=""
escape!=FALSE
oflag&=0
'
' *** set mouse
~GRAF_MOUSE(0,0)
'
' ***load rsrc
IF RSRC_LOAD("b:\rscpop.rsc")=0
  '
  b$="[ |??? WHERE IS IT ??? | | Missing .RSC File   | ]"
  ~FORM_ALERT(1,"[1]"+b$+"[ABORT]")
  '
ELSE
  '
  ~RSRC_GADDR(0,tree&,a%)
  rsc_adr%=a%
  '
  PAUSE 30
  '
  '  OB_X(rsc_adr%,0)=34
  ~OBJC_DRAW(rsc_adr%,0,4,0,0,0,0)
  ' PRINT OB_X(rsc_adr%,15)
  ' ~OBJC_OFFSET(rsc_adr%,15,x_abs&,y_abs&)
  ' PRINT x_abs&
  '
  ' *****************************************
  ' ************* MAIN LOOP *****************
  ' *****************************************
  '
  DO
    '
    a&=FORM_DO(rsc_adr%,0)
    PRINT AT(1,1);USING "###",a&
    '
    SELECT a&
      '
    CASE 2
      '
      ' *** set obj flag to unhide
      OB_FLAGS(rsc_adr%,16)=BCLR(OB_FLAGS(rsc_adr%,16),7)
      '
      ' *** get graf secion we are to draw upon
      GET OB_X(rsc_adr%,16)-1,OB_Y(rsc_adr%,16)-2,OB_X(rsc_adr%,16)+OB_W(rsc_adr%,16)+6,OB_Y(rsc_adr%,16)+OB_H(rsc_adr%,16)+6,a$
      '
      ' *** draw hidden objects
      ~OBJC_DRAW(rsc_adr%,16,1,0,0,0,0)
      '
      ' *** incase of mouse depressed
      WHILE MOUSEK
      WEND
      '
      ' *** loops until mouse button>0  or mouse co-ords exceed parameters
      REPEAT
        '
        a&=OBJC_FIND(rsc_adr%,0,2,MOUSEX,MOUSEY)
        mk&=MOUSEK
        '
        IF mk&
          ~FORM_DO(rsc_adr%,0)
          PRINT AT(1,1);USING "###",a&
        ENDIF
        '
      UNTIL MOUSEX<OB_X(rsc_adr%,1) OR MOUSEX>OB_X(rsc_adr%,1)+OB_W(rsc_adr%,1) OR MOUSEY<OB_Y(rsc_adr%,1) OR MOUSEY>OB_H(rsc_adr%,1)+OB_H(rsc_adr%,16) OR mk&
      '
      ' *** set obj flag to hide
      OB_FLAGS(rsc_adr%,16)=BSET(OB_FLAGS(rsc_adr%,16),7)
      '
      ' *** insert  intersect screen rectangle
      PUT OB_X(rsc_adr%,16)-1,OB_Y(rsc_adr%,16)-2,a$
      '
      ' *** redraw affected objs
      ~OBJC_DRAW(rsc_adr%,1,0,0,0,0,0)
      ~OBJC_DRAW(rsc_adr%,2,0,0,0,0,0)
      '
      ' *** incase of mouse depressed
      WHILE MOUSEK
      WEND
      '
      '
    CASE 3,12,13,14
      '
      ' *********************************************************
      ' *** diff then above routine ,,this was first attempt
      ' *** set flag , show items , but since objc_draw()
      ' *** placed object over a higher #obj
      ' *** had some conflicts.......example:
      ' *** - can activate other objs while in pull down
      ' *** - had to deactivate higher # objs due to interferance
      ' *********************************************************
      '
      oflag&=OB_FLAGS(rsc_adr%,11)
      OB_FLAGS(rsc_adr%,11)=oflag& XOR 128
      '
      IF BTST(oflag&,7)
        '
        ~OBJC_DELETE(rsc_adr%,15)
        GET OB_X(rsc_adr%,11)-1,OB_Y(rsc_adr%,11)-2,OB_X(rsc_adr%,11)+OB_W(rsc_adr%,11)+6,OB_Y(rsc_adr%,11)+OB_H(rsc_adr%,11)+6,a$
        ~OBJC_DRAW(rsc_adr%,11,1,0,0,0,0)
        '
      ELSE
        '
        ~OBJC_ADD(rsc_adr%,0,15)
        PUT OB_X(rsc_adr%,11)-1,OB_Y(rsc_adr%,11)-2,a$
        ~OBJC_DRAW(rsc_adr%,3,0,0,0,0,0)
        '
        WHILE MOUSEK
        WEND
        '
      ENDIF
      '
    CASE 10
      '
      escape!=TRUE
      '
    ENDSELECT
    '
  LOOP UNTIL escape!
  '
ENDIF
'
~RSRC_FREE()
'
END
'
' eof
You do not have the required permissions to view the files attached to this post.
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 1 guest