WideStudio/MWT Logo
WideStudio/MWT
Programming Guide
WideStudio/MWT 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(Mwt::True)
      end
    end
    
    # EXIT  À̺¥Æ® ÇÁ·Î½ÃÀúº»Ã¼
    # Á¾·á½Ã¿¡´Â ´ëÈ­ »óÀÚ¸¦ Ç¥½ÃÇÑ´Ù.
    def exit_ep(object)
      if object.getVisible() != Mwt::False
        return
      end
      msg = Mwt::WSGIappMessageDialog() #A
      msg.setProperty("width",500)
      msg.setProperty("no",Mwt::True)
      msg.setProperty("defaultPosition",Mwt::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 = Mwt::WSCbase::getNewInstance("WSCvtimer",parent,"objname")
        timer.init
        timer.setProperty("interval",250)
        timer.setProperty("cont",Mwt::False)
        timer.addProcedure("delay-popup","delayproc",Mwt::WSEV_ACTIVATE)
      end
    
      if ret == Mwt::WS_DIALOG_OK         # OK ´ÜÃß°¡ ´­¸° °æ¿ì C
        # saving some data ...
        exit 0
      elsif ret == Mwt::WS_DIALOG_NO      # NO ´ÜÃß°¡ ´­¸° °æ¿ì D
        exit 0
      elsif ret == Mwt::WS_DIALOG_CANCEL        # CANCEL ´ÜÃß°¡ ´­¸° °æ¿ì E
        target = object
        timer.setProperty("running",Mwt::True)   # ŸÀ̸Ӹ¦ ±âµ¿
      end
    end
    

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

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

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



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


    Document Release 3.90 for WideStudio/MWT ver 3.90, Jul 2005


    WideStudio/MWT documents index | Table of contents

    Copyright(C) WideStudio/MWT Development Team, 1999-2005 Last modified: Jul 31, 2005