From: shelarcy <she...@gm...> - 2007-11-25 02:53:20
|
DarcsURL: C:/home/shelarcy/wxhaskell=0A= MIME-Version: 1.0=0A= Content-Type: multipart/mixed; boundary=3D"=3D_"=0A= =0A= --=3D_=0A= Content-Type: text/plain=0A= Content-Transfer-Encoding: quoted-printable=0A= =0A= Fri Nov 23 18:53:57 =3D93=3D8C=3D8B=3D9E (=3D95W=3D8F=3D80=3D8E=3D9E) = 2007 shelarcy <shelarc=3D=0A= y...@gm...>=0A= * Move drag-and-drop events to Graphics.UI.WCCore.Events=0A= =0A= Sat Nov 24 21:44:29 =3D93=3D8C=3D8B=3D9E (=3D95W=3D8F=3D80=3D8E=3D9E) = 2007 shelarcy <shelarc=3D=0A= y...@gm...>=0A= * Add drag and drop events to wxStyledTextCtrl=0A= =0A= Sat Nov 24 23:33:23 =3D93=3D8C=3D8B=3D9E (=3D95W=3D8F=3D80=3D8E=3D9E) = 2007 shelarcy <shelarc=3D=0A= y...@gm...>=0A= * Add tests for wxStyledTextCtrl=0A= =0A= Sun Nov 25 11:14:23 =3D93=3D8C=3D8B=3D9E (=3D95W=3D8F=3D80=3D8E=3D9E) = 2007 shelarcy <shelarc=3D=0A= y...@gm...>=0A= * Fix typo and incorrect compilation flag in stc.cpp=0A= =0A= --=3D_=0A= Content-Type: text/x-darcs-patch; = name=3D"move-drag_and_drop-events-to-graphics_ui_wccore_events.dpatch"=0A= Content-Transfer-Encoding: quoted-printable=0A= Content-Description: A darcs patch for your repository!=0A= =0A= =0A= New patches:=0A= =0A= [Move drag-and-drop events to Graphics.UI.WCCore.Events=0A= shelarcy <she...@gm...>**20071123095357] {=0A= hunk ./makefile 90=0A= - Graphics/UI/WXCore/DragAndDrop \=0A= hunk ./makefile 91=0A= + Graphics/UI/WXCore/DragAndDrop \=0A= hunk ./makefile 123=0A= - Graphics/UI/WXCore/DragAndDrop \=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 16=0A= +=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 22=0A= -=0A= - -- * Set event handlers=0A= - -- ** Drop Target events=0A= - , DragResult (..)=0A= - , dropTargetOnData=0A= - , dropTargetOnDrop=0A= - , dropTargetOnEnter=0A= - , dropTargetOnDragOver=0A= - , dropTargetOnLeave=0A= - =3D=0A= =0A= - -- ** On DragAndDropEvent=0A= - , DragMode (..)=0A= - , dragAndDrop=0A= - =3D=0A= =0A= - -- ** Special handler for Drop File event=0A= - , fileDropTarget=0A= - -- ** Special handler for Drop Text event =3D=0A= =0A= - , textDropTarget=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 25=0A= +import Graphics.UI.WXCore.Events=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 37=0A= -import Foreign.Marshal.Utils=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 50=0A= -{-----------------------------------------------------------------------= --=3D=0A= ----------------=0A= - Drag and Drop events=0A= -------------------------------------------------------------------------= --=3D=0A= ---------------}=0A= --- | Drag results=0A= -data DragResult=0A= - =3D3D DragError=0A= - | DragNone=0A= - | DragCopy=0A= - | DragMove=0A= - | DragLink=0A= - | DragCancel=0A= - | DragUnknown=0A= - deriving (Eq,Show)=0A= -=0A= -dragResults :: [(Int, DragResult)]=0A= -dragResults=0A= - =3D3D [(wxDRAG_ERROR ,DragError)=0A= - ,(wxDRAG_NONE ,DragNone)=0A= - ,(wxDRAG_COPY ,DragCopy)=0A= - ,(wxDRAG_MOVE ,DragMove)=0A= - ,(wxDRAG_LINK ,DragLink)=0A= - ,(wxDRAG_CANCEL ,DragCancel)]=0A= -=0A= -fromDragResult :: DragResult -> Int=0A= -fromDragResult drag=0A= - =3D3D case drag of=0A= - DragError -> wxDRAG_ERROR=0A= - DragNone -> wxDRAG_NONE=0A= - DragCopy -> wxDRAG_COPY=0A= - DragMove -> wxDRAG_MOVE=0A= - DragLink -> wxDRAG_LINK=0A= - DragCancel -> wxDRAG_CANCEL=0A= - DragUnknown -> wxDRAG_ERROR=0A= -=0A= -toDragResult :: Int -> DragResult=0A= -toDragResult drag=0A= - =3D3D case lookup drag dragResults of=0A= - Just x -> x=0A= - Nothing -> DragError=0A= -=0A= --- | Set an event handler that is called when the drop target can be = fille=3D=0A= d with data.=0A= --- This function require to use 'dropTargetGetData' in your event = handler =3D=0A= to fill data.=0A= -dropTargetOnData :: DropTarget a -> (Point -> DragResult -> IO = DragResult)=3D=0A= -> IO ()=0A= -dropTargetOnData drop event =3D3D do=0A= - funPtr <- dragThreeFuncHandler event=0A= - wxcDropTargetSetOnData (objectCast drop) (toCFunPtr funPtr)=0A= -=0A= --- | Set an event handler for an drop command in a drop target.=0A= -dropTargetOnDrop :: DropTarget a -> (Point -> IO Bool) -> IO ()=0A= -dropTargetOnDrop drop event =3D3D do=0A= - funPtr <- dragTwoFuncHandler event=0A= - wxcDropTargetSetOnDrop (objectCast drop) (toCFunPtr funPtr)=0A= -=0A= --- | Set an event handler for an enter command in a drop target.=0A= -dropTargetOnEnter :: DropTarget a -> (Point -> DragResult -> IO = DragResult=3D=0A= ) -> IO ()=0A= -dropTargetOnEnter drop event =3D3D do=0A= - funPtr <- dragThreeFuncHandler event=0A= - wxcDropTargetSetOnEnter (objectCast drop) (toCFunPtr funPtr)=0A= -=0A= --- | Set an event handler for a drag over command in a drop target.=0A= -dropTargetOnDragOver :: DropTarget a -> (Point -> DragResult -> IO = DragRes=3D=0A= ult) -> IO ()=0A= -dropTargetOnDragOver drop event =3D3D do=0A= - funPtr <- dragThreeFuncHandler event=0A= - wxcDropTargetSetOnDragOver (objectCast drop) (toCFunPtr funPtr)=0A= -=0A= --- | Set an event handler for a leave command in a drop target.=0A= -dropTargetOnLeave :: DropTarget a -> (IO ()) -> IO ()=0A= -dropTargetOnLeave drop event =3D3D do=0A= - funPtr <- dragZeroFuncHandler event=0A= - wxcDropTargetSetOnLeave (objectCast drop) (toCFunPtr funPtr)=0A= -=0A= -dragZeroFuncHandler event =3D3D=0A= - dragZeroFunc $ \obj -> do=0A= - event=0A= -=0A= -dragTwoFuncHandler event =3D3D=0A= - dragTwoFunc $ \obj x y -> do=0A= - result <- event (point (fromIntegral x) (fromIntegral y))=0A= - return $ fromBool result=0A= -=0A= -dragThreeFuncHandler event =3D3D=0A= - dragThreeFunc $ \obj x y pre -> do=0A= - result <- event (point (fromIntegral x) (fromIntegral y)) = (toDragResul=3D=0A= t $ fromIntegral pre)=0A= - return $ fromIntegral $ fromDragResult result=0A= -=0A= --- | Set an event handler for a drag & drop command between drag source = wi=3D=0A= ndow and drop=0A= --- target. You must set 'dropTarget' before use this action.=0A= --- And If you use 'fileDropTarget' or 'textDropTarget', you need not = use t=3D=0A= his.=0A= -dragAndDrop :: DropSource a -> DragMode -> (DragResult -> IO ()) -> IO = ()=0A= -dragAndDrop drSrc flag event =3D3D do=0A= - result <- dropSourceDoDragDrop drSrc (fromDragMode flag)=0A= - case lookup result dragResults of=0A= - Just x -> event x=0A= - Nothing -> return ()=0A= -=0A= hunk ./wxcore/src/Graphics/UI/WXCore/DragAndDrop.hs 95=0A= --- | Set an event handler that is called when text is dropped in target = wi=3D=0A= ndow.=0A= -textDropTarget :: Window a -> TextDataObject b -> (Point -> String -> = IO (=3D=0A= )) -> IO ()=0A= -textDropTarget window textData event =3D3D do=0A= - funPtr <- dropTextHandler event=0A= - textDrop <- wxcTextDropTargetCreate nullPtr (toCFunPtr funPtr)=0A= - dropTargetSetDataObject textDrop textData=0A= - windowSetDropTarget window textDrop=0A= -=0A= -dropTextHandler event =3D3D=0A= - wrapTextDropHandler $ \obj x y cstr -> do=0A= - str <- peekCWString cstr=0A= - event (point (fromIntegral x) (fromIntegral y)) str=0A= -=0A= --- | Set an event handler that is called when files are dropped in = target =3D=0A= window.=0A= -fileDropTarget :: Window a -> (Point -> [String] -> IO ()) -> IO ()=0A= -fileDropTarget window event =3D3D do=0A= - funPtr <- dropFileHandler event=0A= - fileDrop <- wxcFileDropTargetCreate nullPtr (toCFunPtr funPtr)=0A= - windowSetDropTarget window fileDrop=0A= -=0A= -dropFileHandler event =3D3D=0A= - wrapFileDropHandler $ \obj x y carr size -> do=0A= - arr <- peekArray (fromIntegral size) carr=0A= - files <- mapM peekCWString arr=0A= - event (point (fromIntegral x) (fromIntegral y)) files=0A= -=0A= -data DragMode =3D3D CopyOnly | AllowMove | Default=0A= - deriving (Eq,Show)=0A= - -- deriving (Eq,Show,Read,Typeable)=0A= -=0A= -fromDragMode :: DragMode -> Int=0A= -fromDragMode mode=0A= - =3D3D case mode of=0A= - CopyOnly -> wxDRAG_COPYONLY=0A= - AllowMove -> wxDRAG_ALLOWMOVE=0A= - Default -> wxDRAG_DEFALUTMOVE=0A= -=0A= -foreign import ccall "wrapper" dragZeroFunc :: (Ptr obj -> IO ()) -> IO = (F=3D=0A= unPtr (Ptr obj -> IO ()))=0A= -foreign import ccall "wrapper" dragTwoFunc :: (Ptr obj -> CInt -> CInt = -> =3D=0A= IO CInt) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> IO CInt))=0A= -foreign import ccall "wrapper" dragThreeFunc :: (Ptr obj -> CInt -> = CInt -=3D=0A= > CInt -> IO CInt) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> CInt -> IO = CIn=3D=0A= t))=0A= -foreign import ccall "wrapper" wrapTextDropHandler :: (Ptr obj -> CInt = -> =3D=0A= CInt -> Ptr CWchar -> IO ()) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> = Ptr =3D=0A= CWchar -> IO ()))=0A= -foreign import ccall "wrapper" wrapFileDropHandler :: (Ptr obj -> CInt = -> =3D=0A= CInt -> Ptr (Ptr CWchar) -> CInt -> IO ()) -> IO (FunPtr (Ptr obj -> = CInt -=3D=0A= > CInt -> Ptr (Ptr CWchar) -> CInt -> IO ()))=0A= -=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 154=0A= + -- * Set event handlers=0A= + -- ** Drop Target events=0A= + , DragResult (..)=0A= + , dropTargetOnData=0A= + , dropTargetOnDrop=0A= + , dropTargetOnEnter=0A= + , dropTargetOnDragOver=0A= + , dropTargetOnLeave=0A= + =3D=0A= =0A= + -- ** On DragAndDropEvent=0A= + , DragMode (..)=0A= + , dragAndDrop=0A= + =3D=0A= =0A= + -- ** Special handler for Drop File event=0A= + , fileDropTarget=0A= + -- ** Special handler for Drop Text event =3D=0A= =0A= + , textDropTarget=0A= +=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 236=0A= +import Foreign.Marshal.Utils=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 1884=0A= +{-----------------------------------------------------------------------= --=3D=0A= ----------------=0A= + Drag and Drop events=0A= +------------------------------------------------------------------------= --=3D=0A= ---------------}=0A= +-- | Drag results=0A= +data DragResult=0A= + =3D3D DragError=0A= + | DragNone=0A= + | DragCopy=0A= + | DragMove=0A= + | DragLink=0A= + | DragCancel=0A= + | DragUnknown=0A= + deriving (Eq,Show)=0A= +=0A= +dragResults :: [(Int, DragResult)]=0A= +dragResults=0A= + =3D3D [(wxDRAG_ERROR ,DragError)=0A= + ,(wxDRAG_NONE ,DragNone)=0A= + ,(wxDRAG_COPY ,DragCopy)=0A= + ,(wxDRAG_MOVE ,DragMove)=0A= + ,(wxDRAG_LINK ,DragLink)=0A= + ,(wxDRAG_CANCEL ,DragCancel)]=0A= +=0A= +fromDragResult :: DragResult -> Int=0A= +fromDragResult drag=0A= + =3D3D case drag of=0A= + DragError -> wxDRAG_ERROR=0A= + DragNone -> wxDRAG_NONE=0A= + DragCopy -> wxDRAG_COPY=0A= + DragMove -> wxDRAG_MOVE=0A= + DragLink -> wxDRAG_LINK=0A= + DragCancel -> wxDRAG_CANCEL=0A= + DragUnknown -> wxDRAG_ERROR=0A= +=0A= +toDragResult :: Int -> DragResult=0A= +toDragResult drag=0A= + =3D3D case lookup drag dragResults of=0A= + Just x -> x=0A= + Nothing -> DragError=0A= +=0A= +-- | Set an event handler that is called when the drop target can be = fille=3D=0A= d with data.=0A= +-- This function require to use 'dropTargetGetData' in your event = handler =3D=0A= to fill data.=0A= +dropTargetOnData :: DropTarget a -> (Point -> DragResult -> IO = DragResult)=3D=0A= -> IO ()=0A= +dropTargetOnData drop event =3D3D do=0A= + funPtr <- dragThreeFuncHandler event=0A= + wxcDropTargetSetOnData (objectCast drop) (toCFunPtr funPtr)=0A= +=0A= +-- | Set an event handler for an drop command in a drop target.=0A= +dropTargetOnDrop :: DropTarget a -> (Point -> IO Bool) -> IO ()=0A= +dropTargetOnDrop drop event =3D3D do=0A= + funPtr <- dragTwoFuncHandler event=0A= + wxcDropTargetSetOnDrop (objectCast drop) (toCFunPtr funPtr)=0A= +=0A= +-- | Set an event handler for an enter command in a drop target.=0A= +dropTargetOnEnter :: DropTarget a -> (Point -> DragResult -> IO = DragResult=3D=0A= ) -> IO ()=0A= +dropTargetOnEnter drop event =3D3D do=0A= + funPtr <- dragThreeFuncHandler event=0A= + wxcDropTargetSetOnEnter (objectCast drop) (toCFunPtr funPtr)=0A= +=0A= +-- | Set an event handler for a drag over command in a drop target.=0A= +dropTargetOnDragOver :: DropTarget a -> (Point -> DragResult -> IO = DragRes=3D=0A= ult) -> IO ()=0A= +dropTargetOnDragOver drop event =3D3D do=0A= + funPtr <- dragThreeFuncHandler event=0A= + wxcDropTargetSetOnDragOver (objectCast drop) (toCFunPtr funPtr)=0A= +=0A= +-- | Set an event handler for a leave command in a drop target.=0A= +dropTargetOnLeave :: DropTarget a -> (IO ()) -> IO ()=0A= +dropTargetOnLeave drop event =3D3D do=0A= + funPtr <- dragZeroFuncHandler event=0A= + wxcDropTargetSetOnLeave (objectCast drop) (toCFunPtr funPtr)=0A= +=0A= +dragZeroFuncHandler event =3D3D=0A= + dragZeroFunc $ \obj -> do=0A= + event=0A= +=0A= +dragTwoFuncHandler event =3D3D=0A= + dragTwoFunc $ \obj x y -> do=0A= + result <- event (point (fromIntegral x) (fromIntegral y))=0A= + return $ fromBool result=0A= +=0A= +dragThreeFuncHandler event =3D3D=0A= + dragThreeFunc $ \obj x y pre -> do=0A= + result <- event (point (fromIntegral x) (fromIntegral y)) = (toDragResul=3D=0A= t $ fromIntegral pre)=0A= + return $ fromIntegral $ fromDragResult result=0A= +=0A= +-- | Set an event handler for a drag & drop command between drag source = wi=3D=0A= ndow and drop=0A= +-- target. You must set 'dropTarget' before use this action.=0A= +-- And If you use 'fileDropTarget' or 'textDropTarget', you need not = use t=3D=0A= his.=0A= +dragAndDrop :: DropSource a -> DragMode -> (DragResult -> IO ()) -> IO = ()=0A= +dragAndDrop drSrc flag event =3D3D do=0A= + result <- dropSourceDoDragDrop drSrc (fromDragMode flag)=0A= + case lookup result dragResults of=0A= + Just x -> event x=0A= + Nothing -> return ()=0A= +=0A= +-- | Set an event handler that is called when text is dropped in target = wi=3D=0A= ndow.=0A= +textDropTarget :: Window a -> TextDataObject b -> (Point -> String -> = IO (=3D=0A= )) -> IO ()=0A= +textDropTarget window textData event =3D3D do=0A= + funPtr <- dropTextHandler event=0A= + textDrop <- wxcTextDropTargetCreate nullPtr (toCFunPtr funPtr)=0A= + dropTargetSetDataObject textDrop textData=0A= + windowSetDropTarget window textDrop=0A= +=0A= +dropTextHandler event =3D3D=0A= + wrapTextDropHandler $ \obj x y cstr -> do=0A= + str <- peekCWString cstr=0A= + event (point (fromIntegral x) (fromIntegral y)) str=0A= +=0A= +-- | Set an event handler that is called when files are dropped in = target =3D=0A= window.=0A= +fileDropTarget :: Window a -> (Point -> [String] -> IO ()) -> IO ()=0A= +fileDropTarget window event =3D3D do=0A= + funPtr <- dropFileHandler event=0A= + fileDrop <- wxcFileDropTargetCreate nullPtr (toCFunPtr funPtr)=0A= + windowSetDropTarget window fileDrop=0A= +=0A= +dropFileHandler event =3D3D=0A= + wrapFileDropHandler $ \obj x y carr size -> do=0A= + arr <- peekArray (fromIntegral size) carr=0A= + files <- mapM peekCWString arr=0A= + event (point (fromIntegral x) (fromIntegral y)) files=0A= +=0A= +data DragMode =3D3D CopyOnly | AllowMove | Default=0A= + deriving (Eq,Show)=0A= + -- deriving (Eq,Show,Read,Typeable)=0A= +=0A= +fromDragMode :: DragMode -> Int=0A= +fromDragMode mode=0A= + =3D3D case mode of=0A= + CopyOnly -> wxDRAG_COPYONLY=0A= + AllowMove -> wxDRAG_ALLOWMOVE=0A= + Default -> wxDRAG_DEFALUTMOVE=0A= +=0A= +foreign import ccall "wrapper" dragZeroFunc :: (Ptr obj -> IO ()) -> IO = (F=3D=0A= unPtr (Ptr obj -> IO ()))=0A= +foreign import ccall "wrapper" dragTwoFunc :: (Ptr obj -> CInt -> CInt = -> =3D=0A= IO CInt) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> IO CInt))=0A= +foreign import ccall "wrapper" dragThreeFunc :: (Ptr obj -> CInt -> = CInt -=3D=0A= > CInt -> IO CInt) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> CInt -> IO = CIn=3D=0A= t))=0A= +foreign import ccall "wrapper" wrapTextDropHandler :: (Ptr obj -> CInt = -> =3D=0A= CInt -> Ptr CWchar -> IO ()) -> IO (FunPtr (Ptr obj -> CInt -> CInt -> = Ptr =3D=0A= CWchar -> IO ()))=0A= +foreign import ccall "wrapper" wrapFileDropHandler :: (Ptr obj -> CInt = -> =3D=0A= CInt -> Ptr (Ptr CWchar) -> CInt -> IO ()) -> IO (FunPtr (Ptr obj -> = CInt -=3D=0A= > CInt -> Ptr (Ptr CWchar) -> CInt -> IO ()))=0A= +=0A= }=0A= =0A= [Add drag and drop events to wxStyledTextCtrl=0A= shelarcy <she...@gm...>**20071124124429] {=0A= hunk ./wxc/include/stc.h 45=0A= -=0A= +TClass(wxString) wxStyledTextEvent_GetDragText( = TSelf(wxStyledTextEvent) _=3D=0A= obj );=0A= hunk ./wxc/include/stc.h 47=0A= +int wxStyledTextEvent_GetDragResult( TSelf(wxStyledTextEvent) _obj );=0A= hunk ./wxc/include/stc.h 76=0A= -/* we have no wxDragResult */=0A= hunk ./wxc/include/stc.h 77=0A= +void wxStyledTextEvent_SetDragResult( TSelf(wxStyledTextEvent) _obj, = int v=3D=0A= al);=0A= hunk ./wxc/src/stc.cpp 304=0A= +EWXWEXPORT(void*, wxStyledTextEvent_GetDragText) (void* _obj)=0A= +{=0A= +#ifdef wxUSE_STC=0A= + wxString s =3D3D ((wxStyledTextEvent*) _obj)->GetDragText();=0A= + wxString* ss =3D3D new wxString(s);=0A= + return ss;=0A= +#else=0A= + return false;=0A= +#endif=0A= +}=0A= +=0A= hunk ./wxc/src/stc.cpp 324=0A= +EWXWEXPORT(int, wxStyledTextEvent_GetDragResult) (void* _obj)=0A= +{=0A= +#ifdef wxUSE_STC=0A= + return ((wxStyledTextEvent*) _obj)->GetDragResult();=0A= +#else=0A= + return false;=0A= +#endif=0A= +}=0A= +=0A= hunk ./wxc/src/stc.cpp 517=0A= -/* we have no wxDragResult=0A= hunk ./wxc/src/stc.cpp 525=0A= -*/=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 167=0A= - -- ** Special handler for Drop File event=0A= + -- *** Special handler for Drop File event=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 169=0A= - -- ** Special handler for Drop Text event =3D=0A= =0A= + -- *** Special handler for Drop Text event =3D=0A= =0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 405=0A= --- kolmodin 20050304:=0A= --- Drag and drop is not implemented in wxHaskell yet,=0A= --- events related to this is appear as STCUnknown instead.=0A= --- STCUnknown events are ignored and not passed along to the user.=0A= -=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 432=0A= --- | STCStartDrag -- ^ ** wxEVT_STC_START_DRAG.=0A= --- | STCDragOver -- ^ ** wxEVT_STC_DRAG_OVER=0A= --- | STCDoDrop -- ^ ** wxEVT_STC_DO_DROP=0A= + | STCStartDrag Int Int String -- ^ ! = wxEVT_STC_START_DRAG.=0A= + | STCDragOver Point DragResult -- ^ ! wxEVT_STC_DRAG_OVER=0A= + | STCDoDrop String DragResult -- ^ ! wxEVT_STC_DO_DROP=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 440=0A= - | STCUnknown -- ^ Unknown event. Should never occur.=0A= + | STCUnknown -- ^ Unknown event. Should never occur.=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 461=0A= --- show STCStartDrag =3D3D "(stc event: start drag)"=0A= --- show STCDragOver =3D3D "(stc event: drag over)"=0A= --- show STCDoDrop =3D3D "(stc event: do drop)"=0A= + show (STCStartDrag lin car str) =3D3D "(stc event: start drag, line = " ++=3D=0A= show lin ++ ", caret " ++ show car ++ ", text " ++ show str ++ ")"=0A= + show (STCDragOver p res) =3D3D "(stc event: drag over, (x,y) " ++ = show p=3D=0A= ++ ", dragResult " ++ show res ++ ")"=0A= + show (STCDoDrop str res) =3D3D "(stc event: do drop, text " ++ show = str =3D=0A= ++ ", dragResult " ++ show res ++ ")"=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 497=0A= - , (wxEVT_STC_START_DRAG, \_ -> return STCUnknown) = --STCStartDr=3D=0A= ag)=0A= - , (wxEVT_STC_DRAG_OVER, \_ -> return STCUnknown) = --STCDragOve=3D=0A= r)=0A= - , (wxEVT_STC_DO_DROP, \_ -> return STCUnknown) = --STCDoDrop)=0A= + , (wxEVT_STC_START_DRAG, startDrag)=0A= + , (wxEVT_STC_DRAG_OVER, dragOver)=0A= + , (wxEVT_STC_DO_DROP, doDrop)=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 503=0A= - -- TODO: STCAutocompSelection event is not tested yet.=0A= + -- TODO: STCAutocompSelection event is not tested yet.=0A= hunk ./wxcore/src/Graphics/UI/WXCore/Events.hs 562=0A= + startDrag evt =3D3D do=0A= + lin <- styledTextEventGetLine evt=0A= + car <- styledTextEventGetPosition evt=0A= + str <- styledTextEventGetDragText evt=0A= + return $ STCStartDrag lin car str=0A= + dragOver evt =3D3D do=0A= + x <- styledTextEventGetX evt=0A= + y <- styledTextEventGetY evt=0A= + res <- styledTextEventGetDragResult evt=0A= + return $ STCDragOver (point x y) $ toDragResult res=0A= + doDrop evt =3D3D do=0A= + str <- styledTextEventGetDragText evt=0A= + res <- styledTextEventGetDragResult evt=0A= + return $ STCDoDrop str $ toDragResult res=0A= }=0A= =0A= [Add tests for wxStyledTextCtrl=0A= shelarcy <she...@gm...>**20071124143323] {=0A= addfile ./samples/test/STC.hs=0A= hunk ./samples/test/STC.hs 1=0A= +=0A= +import Graphics.UI.WX=0A= +import Graphics.UI.WXCore=0A= +=0A= +main =3D3D start $ do=0A= + f <- frame [text :=3D3D "Scintilla Test"]=0A= + s <- styledTextCtrlCreate f 0 "bla" (Rect 0 0 500 500) 0=0A= + styledTextCtrlInsertText s 0 "hello world!"=0A= + return ()=0A= addfile ./samples/test/STC2.hs=0A= hunk ./samples/test/STC2.hs 1=0A= +=0A= +import Graphics.UI.WX=0A= +import Graphics.UI.WXCore=0A= +=0A= +main =3D3D start $ do=0A= + f <- frame [text :=3D3D "Scintilla Test"]=0A= + p <- panel f []=0A= + s <- styledTextCtrlCreate f 0 "bla" (Rect 0 0 500 500) 0=0A= + b <- button p [text:=3D3D "print text in console", =3D=0A= =0A= + on command :=3D3D styledTextCtrlGetText s >>=3D3D = putStrLn]=0A= +{- set f [ layout :=3D3D container p $ column 5 [ fill $ widget s, =3D=0A= =0A= + hfill $ widget b], clientSize :=3D3D sz 300 300]-}=0A= + return ()=0A= addfile ./samples/test/STCEvent.hs=0A= hunk ./samples/test/STCEvent.hs 1=0A= -=0A= +=0A= +import Graphics.UI.WX=0A= +import Graphics.UI.WXCore=0A= +=0A= +calltiptext =3D3D "I can write whatever I want here"=0A= +=0A= +main =3D3D start $ do=0A= + f <- frame [text :=3D3D "Scintilla Test"]=0A= + p <- panel f []=0A= + textlog <- textCtrl p [clientSize :=3D3D sz 500 200]=0A= + textCtrlMakeLogActiveTarget textlog=0A= + logMessage "logging enabled"=0A= + s <- styledTextCtrl p []=0A= + set s [on stcEvent :=3D3D handler s]=0A= + styledTextCtrlSetMouseDwellTime s 2000=0A= + set f [ layout :=3D3D container p $ =3D=0A= =0A= + column 5 $ [ fill $ widget s=0A= + , hfill $ widget textlog=0A= + ]=0A= + , clientSize :=3D3D sz 500 500=0A= + ]=0A= +=0A= +handler :: StyledTextCtrl a -> EventSTC -> IO ()=0A= +handler _ STCUpdateUI =3D3D return ()=0A= +handler _ STCStyleNeeded =3D3D return ()=0A= +handler _ STCPainted =3D3D return ()=0A= +handler stc e =3D3D do logMessage $ show e=0A= + case e of=0A= + (STCDwellStart xy) -> do =3D=0A= =0A= + pos <- styledTextCtrlPositionFromPoint stc xy=0A= + styledTextCtrlCallTipShow stc pos calltiptext=0A= + (STCDwellEnd xy) -> do=0A= + active <- styledTextCtrlCallTipActive stc=0A= + when active $ styledTextCtrlCallTipCancel stc=0A= + _ -> return ()=0A= addfile ./samples/test/STCLexer.hs=0A= hunk ./samples/test/STCLexer.hs 1=0A= +module Main where=0A= +=0A= +import Graphics.UI.WX=0A= +import Graphics.UI.WXCore=0A= +=0A= +colorscheme =3D3D [ ( wxSTC_HA_DEFAULT, rgb 0 0 0 )=0A= + , ( wxSTC_HA_IDENTIFIER, rgb 0 0 0 )=0A= + , ( wxSTC_HA_KEYWORD, rgb 0 0 255 )=0A= + , ( wxSTC_HA_NUMBER, rgb 100 100 100 )=0A= + , ( wxSTC_HA_STRING, rgb 100 100 200 )=0A= + , ( wxSTC_HA_CHARACTER, rgb 0 100 200 )=0A= + , ( wxSTC_HA_CLASS, rgb 255 0 255 )=0A= + , ( wxSTC_HA_MODULE, rgb 255 0 0 )=0A= + , ( wxSTC_HA_CAPITAL, rgb 0 255 0 )=0A= + , ( wxSTC_HA_DATA, rgb 255 0 0 )=0A= + , ( wxSTC_HA_IMPORT, rgb 150 0 200 )=0A= + , ( wxSTC_HA_OPERATOR, rgb 256 0 0 )=0A= + , ( wxSTC_HA_INSTANCE, rgb 150 61 90 )=0A= + , ( wxSTC_HA_COMMENTLINE, rgb 10 80 100 )=0A= + , ( wxSTC_HA_COMMENTBLOCK, rgb 0 60 0 )=0A= + , ( wxSTC_HA_COMMENTBLOCK2, rgb 0 30 0 )=0A= + , ( wxSTC_HA_COMMENTBLOCK3, rgb 0 10 0 )=0A= + ]=0A= +=0A= +keywords =3D3D "as case class data default deriving do else hiding if = import=3D=0A= " ++=0A= + "in infix infixl infixr instance let module newtype of = qualifie=3D=0A= d" ++=0A= + "then type where"=0A= +=0A= +main =3D3D start $ do=0A= + f <- frame [text :=3D3D "Scintilla Test", visible :=3D3D False]=0A= + p <- panel f []=0A= + s <- styledTextCtrl p [ clientSize :=3D3D sz 500 500]=0A= + styledTextCtrlLoadFile s "LexerTest.hs"=0A= + styledTextCtrlStyleClearAll s=0A= + styledTextCtrlSetLexer s wxSTC_LEX_HASKELL=0A= + styledTextCtrlSetKeyWords s 0 keywords=0A= + let fontstyle =3D3D fontFixed { _fontFace =3D3D "Monospace" }=0A= + (font, _) <- fontCreateFromStyle fontstyle=0A= + mapM_ (\style -> styledTextCtrlStyleSetFont s style font) = [0..wxSTC_ST=3D=0A= YLE_LASTPREDEFINED]=0A= + sequence_ [styledTextCtrlStyleSetForeground s k c | (k, c) <- = colorsch=3D=0A= eme]=0A= + set f [ layout :=3D3D container p $ fill $ widget s ]=0A= + set f [ visible :=3D3D True ]=0A= }=0A= =0A= [Fix typo and incorrect compilation flag in stc.cpp=0A= shelarcy <she...@gm...>**20071125021423] {=0A= hunk ./wxc/src/stc.cpp 517=0A= -EWXWEXPORT(void, wxStyledTextEvent_SetDragResult) (void* _obj, void* = val)=0A= +EWXWEXPORT(void, wxStyledTextEvent_SetDragResult) (void* _obj, int val)=0A= hunk ./wxc/src/stc.cpp 521=0A= -#else=0A= - return false;=0A= }=0A= =0A= Context:=0A= =0A= [Change VC 2.6 project to build contribs automatically (just support stc = cu=3D=0A= rrently)=0A= shelarcy <she...@gm...>**20071121131543] =3D=0A= =0A= [Update Build Instruction Document for GHC 6.6.x, GHC 6.8.x and latest = darc=3D=0A= s sources=0A= shelarcy <she...@gm...>**20071121130520] =3D=0A= =0A= [FIX #1721764: typo in Graphics.UI.WX.Dialogs's haddock documentation=0A= shelarcy <she...@gm...>**20071121125955] =3D=0A= =0A= [Changed Cursor_CreateLoad to return NULL for WXGTK, as WXGTK do yet = implem=3D=0A= ent this function=0A= Mads Lindstroem <mad...@ya...>**20070916170828] =3D=0A= =0A= [Rename wxcu-2.6.4.* to wxc-2.6.* as wxc-2.4 things=0A= shelarcy <she...@gm...>**20070821050957] =3D=0A= =0A= [Update VC++ project file to reflect updated DLL version supporting = wxWidge=3D=0A= ts 2.6.4=0A= shelarcy <she...@gm...>**20070821044612] =3D=0A= =0A= [Remove old wxc project files between 2.6.0 - 2.6.3=0A= shelarcy <she...@gm...>**20070821043754] =3D=0A= =0A= [Remove old wxh samples=0A= shelarcy <she...@gm...>**20070821043453] =3D=0A= =0A= [Remove auto-generated stc files.=0A= Eric Kow <eri...@lo...>**20070819205954=0A= Otherwise, you get annoying new changes in the working directory.=0A= ] =3D=0A= =0A= [Use Data.Time.getCurrentTime instead of (System.)Time.getClockTime=0A= shelarcy <she...@gm...>**20070819204230=0A= to avoid build failure by generated non-UTF8 String=0A= ] =3D=0A= =0A= [Add Drag & Drop and ClipBoard Support=0A= shelarcy <she...@gm...>**20070815175137] =3D=0A= =0A= [Add (Multi-)MediaCtrl Support=0A= shelarcy <she...@gm...>**20070811123742] =3D=0A= =0A= [Rework wxToolkit and isDefined by fixing *defs' char array to wxChar = array=0A= shelarcy <she...@gm...>**20070806121930] =3D=0A= =0A= [Change some str* functions or wcs* functions to wxStr* functions=0A= shelarcy <she...@gm...>**20070805112624] =3D=0A= =0A= [Remove unused wxh directory files=0A= shelarcy <she...@gm...>**20070803123528] =3D=0A= =0A= [Remove unused wxWidgets 2.5.x's VC project=0A= shelarcy <she...@gm...>**20070803120930] =3D=0A= =0A= [Add VC project for wxWidgets 2.6.4=0A= shelarcy <she...@gm...>**20070803120733] =3D=0A= =0A= [Fix broken wxc-2.4 Visual Studio Project=0A= shelarcy <she...@ho...>**20070723214850] =3D=0A= =0A= [polyline-64bit-compatibility-fix=0A= ar...@cs...**20070313080116=0A= Fixes a problem with the polyline function on a 64-bit platform.=0A= The wxDC_DrawLines function now properly indexes into the array=0A= with points.=0A= ] =3D=0A= =0A= [fix-polygon-behaviour-64=0A= ar...@cs...**20070202154517=0A= Fixed issue 'Strange polygon behaviour on 64-bit machines'=0A= reported by Chris Mears at 14 Dec 2006.=0A= =3D=0A= =0A= Problem: the arrays inspected by the wxDC_Polygon function=0A= are assumed to contain 32-bits ints. On 64-bit machines=0A= these are actually 64-bits ints.=0A= =3D=0A= =0A= Fix: (a bit of a hack...) the code now assumes that the=0A= arrays contain intptr_t values. This type represents ints=0A= of the same number of bits as the Haskell ints (on 32-bit=0A= and 64-bit machines). The code now dereferences each element=0A= in the array correctly, but still truncates the possibly=0A= 64-bit value to a 32-bit value. This is not a problem=0A= in practice.=0A= ] =3D=0A= =0A= [Announce new maintainers, darcs (homepage).=0A= Eric Kow <eri...@lo...>**20070120231403] =3D=0A= =0A= [Add miscellaneous other images (homepage).=0A= Eric Kow <eri...@lo...>**20070120224435] =3D=0A= =0A= [Add application screenshots (homepage).=0A= Eric Kow <eri...@lo...>**20070120224104] =3D=0A= =0A= [Add images used in quick start (homepage).=0A= Eric Kow <eri...@lo...>**20070120223650] =3D=0A= =0A= [Add images used for samples (homepage).=0A= Eric Kow <eri...@lo...>**20070120223301] =3D=0A= =0A= [Add images directory (and wxhaskell logo).=0A= Eric Kow <eri...@lo...>**20070120222724] =3D=0A= =0A= [Remove counter code from homepage.=0A= Eric Kow <eri...@lo...>**20070120221619=0A= =3D=0A= =0A= This counter has an pop-up ads, which is rather obnoxious.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Add wxhaskell homepage files (main html, css only).=0A= Eric Kow <eri...@lo...>**20070120221304=0A= =3D=0A= =0A= I took the liberty of running dos2unix on these.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Add some wxhaskell-specifile boring file regexps.=0A= Eric Kow <eri...@lo...>**20070120221235] =3D=0A= =0A= [Use a custom boring file. (Right now just the darcs default)=0A= Eric Kow <eri...@lo...>**20070120221223] =3D=0A= =0A= [Add an etc/ directory for misc use.=0A= Eric Kow <eri...@lo...>**20070120212146] =3D=0A= =0A= [Modify wx-install so it doesn't accidentally recompile things.=0A= Eric Kow <eri...@lo...>**20070120225914=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Merge wxStyledTextCntrl (Scintilla edit control wrapper) support from = Hast=3D=0A= e project=0A= shelarcy <she...@ca...>**20070111090641] =3D=0A= =0A= [Added #ifndef compilation flag around <inttypes.h> to avoid building = probl=3D=0A= em under Visual C++ (VC). (VC doesn't have <inttypes.h>.)=0A= she...@ca...**20061207005946] =3D=0A= =0A= [Correct previous patch for db.cpp=0A= she...@ca...**20061207004327] =3D=0A= =0A= [Add an eyeball test for Unicode strings.=0A= Eric Kow <eri...@lo...>**20061129042230] =3D=0A= =0A= [Use intptr_t to avoid assumption that integers are 32 bit.=0A= Arie Middelkoop <ar...@cs...>**20061125125628=0A= =3D=0A= =0A= Compiling wxHaskell on a 64bits platform fails, because there=0A= are some assumptions in the code that assume that integers are=0A= 32bits. For example, there are a couple of assignments of a=0A= pointer to an int.=0A= =3D=0A= =0A= This patch fixes these problems. Sometimes, after assigning a=0A= pointer to an integer, the int was used as a boolean value. In=0A= those cases, instead of returning a pointer p, I changed the=0A= code to return p !=3D3D NULL. In two other cases, a pointer is stored=0A= inside the int and in these cases I changed the type of the=0A= int to intptr_t, of which it is guaranteed that a pointer can be=0A= assigned to it and recovered from it.=0A= =3D=0A= =0A= Requires <inttypes.h>.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Added the -fPIC compiler flag to CXX options in the makefile.=0A= Arie Middelkoop <ar...@cs...>**20061115121006=0A= =3D=0A= =0A= Apparantly, my platform (gentoo x86_64 linux) required that .o files = are "=3D=0A= relocatable" when there =3D=0A= =0A= are linked into a dynamic library.=0A= =3D=0A= =0A= (It might be an idea to use libtool to hide this kind of = platform-specific=3D=0A= details)=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Tweak wx build target to depend on wxcore-clean.=0A= Eric Kow <eri...@lo...>**20061115002142=0A= =3D=0A= =0A= This avoids weird build errors with GHC 6.6 like=0A= wx/src/Graphics/UI/WX/Types.hs:94:0:=0A= Bad interface file: out/wx/imports/Graphics/UI/WXCore/Types.hi=0A= Something is amiss; requested module=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Update Windows/VC++ build for 0.10.1 (from jer...@gm...).=0A= Eric Kow <eri...@lo...>**20061029082957=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Separate make/make install for wxcore and wx.=0A= Eric Kow <eri...@lo...>**20061027201218=0A= =3D=0A= =0A= Now the user has to type=0A= make=0A= (sudo) make install=0A= make wx=0A= (sudo) make wx-install=0A= =3D=0A= =0A= This is a tweak of Shelarcy's patch for making wxhaskell compile on GHC = 6.=3D=0A= 6.=0A= The intention is to avoid the surprising behaviour of wxcore being = install=3D=0A= ed=0A= when the user types 'make'.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Add shelarcy patch for compile with GHC-6.6=0A= jer...@gm...**20061027102208] =3D=0A= =0A= [Add support for toolbar divider and other toolbar options (from = shelarcy@g=3D=0A= mail.com)=0A= jer...@gm...**20061023095411] =3D=0A= =0A= [Add support for toolbar divider (for she...@gm...)=0A= jer...@gm...**20061023094720] =3D=0A= =0A= [Add support for list item mask (from she...@gm...)=0A= jer...@gm...**20061023094528] =3D=0A= =0A= [Add support for Calendar events (from sha...@gm...)=0A= jer...@gm...**20061023094412] =3D=0A= =0A= [Add support for wxWidgets version >=3D3D 2.5 (Sound API, db API)=0A= jer...@gm...**20061023094049] =3D=0A= =0A= [Shelarcy patch: fix typos in wxHaskell samples/contrib=0A= jer...@gm...**20060830114937] =3D=0A= =0A= [(OS X) Skip intermediate step of compiling master.o.=0A= Eric Kow <eri...@lo...>**20060813212620=0A= =3D=0A= =0A= Removing this step (which compiles master.o, and combines it with other=0A= stuff to get the real library we want) avoids weird error messages like=0A= =3D=0A= =0A= ld: out/wxc/master.o undefined symbol 36218 (__ZdaPv) can't be a weak=0A= definition=0A= =3D=0A= =0A= It's quite possible that this breaks something else, though...=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Update VC++ project file to reflect new wxWidgets version support = (unteste=3D=0A= d)=0A= jer...@gm...**20060817170205] =3D=0A= =0A= [Update VC++ project file to reflect updated DLL version supporting = wxWidge=3D=0A= ts 2.6.3=0A= jer...@gm...**20060817170011] =3D=0A= =0A= [Update revision numbers and wxversion guesses for Windows / VC++ = (jeremy.o=3D=0A= don...@gm...)=0A= jer...@gm...**20060817165704] =3D=0A= =0A= [Shelarcy patch (VC project for wxWindows 2.6.3)=0A= jer...@gm...**20060816134707] =3D=0A= =0A= [Shelarcy patch (WxcTypes.hs)=0A= jer...@gm...**20060816115419] =3D=0A= =0A= [Shelarcy patch (eljdialup.cpp)=0A= jer...@gm...**20060816114418] =3D=0A= =0A= [Shelarcy patch (db.cpp)=0A= jer...@gm...**20060816113728] =3D=0A= =0A= [(wxc, Unicode) Files for compiling unicode version under Visual Studio.=0A= shelarcy <she...@ca...>**20060813212315=0A= =3D=0A= =0A= This is Eric Kow recording on Shelarcy's behalf. This corresponds to = vers=3D=0A= ion=0A= 08 of my Unicode patch.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [Add a small makefile for compiling the samples.=0A= Eric Kow <eri...@lo...>**20060813211705=0A= =3D=0A= =0A= (This comes from version 08 of my Unicode patch).=0A= =3D=0A= =0A= ] =3D=0A= =0A= [(wxcore, Unicode) Add/use ability to interact with C wchar_t.=0A= Eric Kow <eri...@lo...>**20060813211211=0A= =3D=0A= =0A= This corresponds to the wxcore part of my Unicode patch, version 08=0A= modulo trailing whitespace.=0A= =3D=0A= =0A= I believe this would require for wxWidgets and wxhaskell to be compiled = wi=3D=0A= th=0A= Unicode enabled.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [(wxdirect, Unicode) Use the Haskell types for C wchar_t and friends.=0A= Eric Kow <eri...@lo...>**20060813210420=0A= =3D=0A= =0A= I believe this would require that wxWidgets be compiled with Unicode=0A= enabled.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [(wxc, Unicode) Use wxChar instead of char.=0A= Eric Kow <eri...@lo...>**20060813205557=0A= =3D=0A= =0A= wxChar is a C preprocessor macro that selects for char under=0A= --disable-unicode, and for wchar_t under --enable-unicode.=0A= =3D=0A= =0A= This corresponds to version 08 of my Unicode patch, but only the parts=0A= which affect wxc.=0A= =3D=0A= =0A= ] =3D=0A= =0A= [[wxhaskell-from-cvs @ 2005-05-08 08:12:51 by dleijen]=0A= dleijen**20050508081251=0A= updated change log=0A= ] =3D=0A= =0A= [[wxhaskell-from-cvs @ 2005-05-08 07:24:23 by dleijen]=0A= dleijen**20050508072423=0A= Compile wx via -fvia-C to fix crash with ghci on windows=0A= ] =3D=0A= =0A= [TAG wxhakell-0-9-4=0A= Unknown tagger**20060712042545] =3D=0A= =0A= Patch bundle hash:=0A= db56123fbbbbb2d2e2452dc5af737684a1b8e0b5=0A= =0A= --=3D_--=0A= =0A= .=0A= =0A= |
From: Eric Y. K. <eri...@gm...> - 2007-12-06 15:31:25
|
Applied. (not yet pushed yet, but should be coming shortly) --=20 Eric Kow http://www.loria.fr/~kow PGP Key ID: 08AC04F9 Merci de corriger mon fran=E7ais. |
From: Eric Y. K. <eri...@gm...> - 2007-12-06 15:34:00
|
I forgot to add * Thanks for all these patches! Sorry for the delays... and especially not telling you that delays would be expected. I'm only now very slowly starting to clear out my mailboxes and get things back under control. * I suspect that it's still trying to build some stuff during make install (when it should just be duing make). That has the potential to be annoying as it creates files owned by root if you do sudo make install. Could you look into it? --=20 Eric Kow http://www.loria.fr/~kow PGP Key ID: 08AC04F9 Merci de corriger mon fran=E7ais. |