WideStudio Logo
WideStudio
Programming Guide
WideStudio Index
Table of contents


EXIT Æ®¸®°Å(trigger)¿¡ÀÇÇÑ Á¾·á À̺¥Æ® ÇÁ·Î½ÃÀú¿¡¼­ ´ëÈ­ »óÀÚ¸¦ Ç¥½ÃÇϱ⿡´Â

À©µµ¿ì¸¦ ´Ý°í ÀÀ¿ëÇÁ·Î±×·¥À» Á¾·áÇÏ´Â °æ¿ì µ¥ÀÌÅÍÀÇ ÀúÀåÀ» ½ÇÇàÇÏ°í³ª Á¾·áÇÒ°¡ ¸»°¡¸¦ ´ëÈ­ »óÀڷΠǥ½ÃÇÒ °æ¿ì°¡ ÀÖ½À´Ï´Ù. ±×·² °æ¿ì WSCwindow / WSCmainWindow Ŭ·¡½ºÀÇ EXIT Æ®¸®°Å(trigger)·Î À̺¥Æ® ÇÁ·Î½ÃÀú ¸¦ ÀÌ¿ëÇÏ¸é º¯¸®ÇÕ´Ï´Ù. WSCwindow/WSCmainWindow Ŭ·¡½º´Â À©µµ¿ì°¡ ºÒ°¡½Ã »óÅ¿¡µÈ °æ¿ì¿¡ EXIT Æ®¸®°Å(trigger)¸¦ ºÒ·¯ ÀÀ¿ëÇÁ·Î±×·¥°¡ Á¾·áÇϱâ Àü¿¡ À̺¥Æ® ÇÁ·Î½ÃÀú¸¦ ½ÇÇàÇÒ ±â´ÉÀ» °¡Áö°íÀÖ½À´Ï´Ù.

¸ÕÀú WSCwindow ȤÀº WSCmainWindow Ŭ·¡½ºÀÇ ¼Ó¼º "exit"À» True ·Î ÇÕ´Ï´Ù. ÀÌ ¼Ó¼ºÀº ÀÀ¿ëÇÁ·Î±×·¥ÁßÀÇ À©µµ¿ì¿¡¼­ ƯÈ÷ ¸ÞÀηΠÀÌ¿ëµÇ´Â°Í¿¡ ¼³Á¤Çϸé ÁÁÀ»°ÍÀÔ´Ï´Ù. ±×·¡¼­ ±× À©µµ¿ì¿¡ ´ëÇØ¼­ EXIT Æ®¸®°Å·Î À̺¥Æ® ÇÁ·Î½ÃÀú¸¦ ºÙ¿©³õ½À´Ï´Ù.

´ÙÀ½°ú °°Àº ±â´ÉÀ» °¡Áö´Â À̺¥Æ® ÇÁ·Î½ÃÀú¸¦ ¸¸µé¾îº¾½Ã´Ù.


  • Á¾·áÇÒ°¡ ¸»°¡ÀÇ ´ëÈ­ »óÀÚ¸¦ Ç¥½Ã.

  • [OK]°¡ ¼±ÅÃµÈ °æ¿ì´Â 󸮸¦ ½ÇÇàÇØ¼­ Á¾·á.

  • [NO]°¡ ¼±ÅÃµÈ °æ¿ì´Â 󸮸¦ ¾ÈÇϰí Á¾·á.

  • [CANCEL]°¡ ¼±ÅÃµÈ °æ¿ì´Â 󸮸¦ ¾ÈÇϰí Á¾·áµµ ¾ÈÇÔ.
  • #----------------------------------------------------------
    #Function for the event procedure
    #----------------------------------------------------------
    # «ª°´Ã¼¸¦ ´Ù½Ã Ç¥½ÃÇϴ ŸÀÌ¸Ó ÇÁ·Î½ÃÀú
    timer = nil
    target = nil
    def delayproc(object)
      if target != nil
        target.setVisible(Mpfc::True)
      end
    end
    
    # EXIT  À̺¥Æ® ÇÁ·Î½ÃÀúº»Ã¼
    # Á¾·á½Ã¿¡´Â ´ëÈ­ »óÀÚ¸¦ Ç¥½ÃÇÑ´Ù.
    def exit_ep(object)
      if object.getVisible() != Mpfc::False
        return
      end
      msg = Mpfc::WSGIappMessageDialog() #A
      msg.setProperty("width",500)
      msg.setProperty("no",Mpfc::True)
      msg.setProperty("defaultPosition",Mpfc::True)
      msg.setProperty("labelString",
        "Exit and save data?\n If you do not want to save and exit,push NO...")
    
      # ´ëÈ­ »óÀÚÀÇ Ç¥½Ã
      ret = msg.popup() #B
    
      # ù ¹øÂ° ½ÇÇà½Ã, ŸÀ̸Ӹ¦ ÀÛ¼º
      if timer == nil
        parent = object.getParentWindow()
        timer = Mpfc::WSCbase::getNewInstance("WSCvtimer",parent,"objname")
        timer.init
        timer.setProperty("interval",250)
        timer.setProperty("cont",Mpfc::False)
        timer.addProcedure("delay-popup","delayproc",Mpfc::WSEV_ACTIVATE)
      end
    
      if ret == Mpfc::WS_DIALOG_OK         # OK ´ÜÃß°¡ ´­¸° °æ¿ì C
        # saving some data ...
        exit 0
      elsif ret == Mpfc::WS_DIALOG_NO      # NO ´ÜÃß°¡ ´­¸° °æ¿ì D
        exit 0
      elsif ret == Mpfc::WS_DIALOG_CANCEL        # CANCEL ´ÜÃß°¡ ´­¸° °æ¿ì E
        target = object
        timer.setProperty("running",Mpfc::True)   # ŸÀ̸Ӹ¦ ±âµ¿
      end
    end
    

    A ¿¡¼­ ¸Þ½ÃÁö ´ëÈ­ »óÀÚ ÀνºÅϽº¸¦ ÃëµæÇØ¼­ B ¿¡¼­ ¸Þ½ÃÁö ´ëÈ­ »óÀÚ¸¦ Ç¥½ÃÇÕ´Ï´Ù.

    C,D,E ¿¡¼­ ´ëÈ­ »óÀÚÀÇ °á°ú¸¦ ÆÇÁ¤Çؼ­ OK ´ÜÃß°¡ ´­·ÈÀ¸¸é C, NO ´ÜÃß°¡ ´­·ÈÀ¸¸é D, CANCEL ´ÜÃß°¡ ´­·ÈÀ¸¸é E ·Î µË´Ï´Ù.

    E ÀÇ Á¾·á¾ÈÇÏ°í ´Ù½Ã Ç¥½ÃÇÒ °æ¿ì, ŸÀ̸Ӹ¦ ¾²°í, Á» ŸÀ̹ÖÀ» ´ÊÃâÇʿ䰡 ÀÖ½À´Ï´Ù. À̰ÍÀº À©µµ¿ì ½Ã½ºÅÛ¿¡ ´ëÇØ ¹Ì¸® È­¸éÁ¾·á À̺¥Æ®°¡ ¹ß»ýÇϰíÀÖÀ¸¹Ç·Î ±× À̺¥Æ®ÀÇ Ã³¸®°¡ È®½ÇÈ÷ 󸮵ǿ´´Ù°¡ Ç¥½Ã¸¦ ½ÇÇàÇá¿©¾ßÇϱ⶧¹®ÀÔ´Ï´Ù.



    £Û Á¾·á È®ÀÎ ´ëÈ­ »óÀÚ£Ý


    Document Release 3.70 for WideStudio ver 3.70, May 2004


    WideStudio documents index | Table of contents

    Copyright(C) WideStudio Development Team, 1999-2004 Last modified: May 25, 2004