Ribbon Limit ---- RESOLVED!!!
Posted: Tue Jan 19, 2010 11:00 am
I want move a bitmap with ldrag procedure into a Main ownd but I want not move over the ribbonbar
How I can make it ?
thanks
How I can make it ?
thanks
www.FiveTechSoft.com
https://fivetechsupport.com/forums/
Code: Select all | Expand
#include "fivewin.ch"
#include "ribbon.ch"
#define GRID_X 10
#define GRID_Y 10
static oWnd
function main()
Local nItem
Local oRBar
Local oMenu
Local oGr1, oGr2, oGr3, oGr4 //GROUPS FOR RIBBON
Local oBtn[30]
DEFINE WINDOW oWnd TITLE "sala de ventas" from 1,1 to 600,600 pixel //brush oBrush1
DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Objectos" HEIGHT 180 TOPMARGIN 55
ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Acciones" width 120
@ 2,5 ADD BUTTON oBtn[1] PROMPT "Grabar" BITMAP "Save.bmp" GROUP oGr1 ROUND SIZE 50,65 action SAVE()
@ 2, 55 ADD BUTTON oBtn[2] PROMPT "SAlir" BITMAP "exit.bmp" GROUP oGr1 ROUND SIZE 50,65 action oWnd:end()
// ADD SEPARATOR TO GROUP oGr2 COL 235
ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "cancellare" width 150
@ 2, 5 ADD BUTTON oBtn[3] PROMPT "Quitar seleccìon" BITMAP "quitar.bmp" GROUP oGr2 ROUND SIZE 100,75 ACTION (nItem :=0)
ADD GROUP oGr3 RIBBON oRBar TO OPTION 1 PROMPT "Mesas" WIDTH 360
@ 2, 5 ADD BUTTON oBtn[10] BITMAP "mesas.bmp" GROUP oGr3 ROUND SIZE 50,75 ACTION (nItem :=7)
SET MESSAGE OF oWnd TO "Disenando sala de ventas" ;
CENTERED CLOCK KEYBOARD 2007
oWnd:bLClicked = { | nRow, nCol, nFlags | create_object(nItem, nRow,nCol) }
SetGridSize( 1, 1 ) //I use this to design easy each object
ACTIVATE WINDOW oWnd ;
ON PAINT DrawGrid( oWnd:hWnd, hDC, cPS, GRID_X, GRID_Y )
oRBar:End()
return nil
//--------------------------------------------------------------------------//
Function create_object(nItem, nRow,nCol)
Local oSprite
Local cBitmap:=""
DO CASE
CASE nItem = 7
cBitmap="mesas.bmp"
CASE nItem = 0
return nil
ENDCASE
@ nRow, nCol BITMAP oSprite;
RESOURCE cBitmap;
PIXEL NOBORDER of oWnd // SIZE 64,64
nTipo:=nItem
oSprite:lTransparent = .T.
//TO MOVE
/* oSprite:Move(oSprite:nTop,; this make error
oSprite:nLeft,;
oSprite:nWidth,;
oSprite:nHeight) */
oSprite:Move(oSprite:nTop,;
oSprite:nLeft,;
,;
)
oSprite:HideDots()
oSprite:lDrag := .T.
oSprite:bMoved := {|| oSprite:CoorsUpdate() ,;
nBmpRow := oSprite:nTop ,;
nBmpCol := oSprite:nLeft ;
}
oSprite:cargo := {cBitmap,nType }
oSprite:bRClicked = { | nRow, nCol | menu_action( oSprite, nRow, nCol ) }
oSprite:SetFocus()
return nil
function menu_action( oSprite, nRow, nCol )
local oMenu
MENU oMenu POPUP 2007
MENUITEM "&Cancel object" action delImg( oSprite,oWnd)
ENDMENU
ACTIVATE MENU oMenu AT nRow, nCol OF oSprite
return nil
Function delImg(oSprite,oWnd)
if MsgYesNo( "Delete this symbol ?" )
oSprite:End()
ENDIF
oWnd:refresh()
return NIL
FUNCTION SAVE()
//grabar
return NIL
Code: Select all | Expand
// Moving a window, with the mouse, without a caption
#include "FiveWin.ch"
function Main()
local oWnd, nRowPos, nColPos, lDrag := .F., oCrsHand
DEFINE CURSOR oCrsHand HAND
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR "W/R"
oWnd:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T., oWnd:oCursor := oCrsHand }
oWnd:bMMoved = { | nRow, nCol | If( lDrag, oWnd:Move( oWnd:nTop + nRow - nRowPos,;
oWnd:nLeft + nCol - nColPos,,, .T. ),) }
oWnd:bLButtonUp := { || lDrag := .F., oWnd:oCursor := nil }
ACTIVATE WINDOW oWnd
return nil
Code: Select all | Expand
#include "fivewin.ch"
*************
function MAIN
*************
local oDlg
define dialog oDlg from 0, 0 to 400, 600 pixel
* Posiciona o cursor do mouse
@10, 10 button "Posicionar" of oDlg action setcursorpos( 200, 300 ) pixel
* Mostra o Mouse na Tela
@30, 10 button "Mostar" of oDlg action SHOW_MOUSE() pixel
* Esconde o Mouse nesta Dialog
@50, 10 button "Esconder" of oDlg action HIDE_MOUSE() pixel
* Confina o Mouse em uma certa posicao da tela
@70, 10 button "Confinar" of oDlg action clipcursor( 10, 10, 10, 10 ) pixel
* Confina o Mouse em uma certa posicao da tela
@90, 10 button "Sair Confinamento" of oDlg ;
action ( clipcursor( 0, 0, 800, 600 ), setcursorpos( 400, 300 ) ) pixel
activate dialog oDlg centered
return NIL
*******************
function HIDE_MOUSE
*******************
local ST_CUR
do while .T.
ST_CUR := ShowCursor( 0 )
if ST_CUR < 0 && Enquanto o Status do ponteiro nao for Menor que Zero
exit
endif
enddo
return NIL
*******************
function SHOW_MOUSE
*******************
local ST_CUR
do while .T.
ST_CUR := ShowCursor( 1 )
if ST_CUR >= 0 && Enquanto o Status do ponteiro for Maior ou igual a Zero
exit
endif
enddo
return NIL
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( CLIPCURSOR )
{
RECT rct;
rct.left = hb_parnl( 1 );
rct.top = hb_parnl( 2 );
rct.right = hb_parnl( 3 );
rct.bottom = hb_parnl( 4 );
hb_retl( ClipCursor( &rct ) );
}
#pragma ENDDUMP