Jump to content
Fivewin Brasil

Posicionar a Dialog Calendário


maudruidas

Recommended Posts

Bom dia, tenho um GET que chama meu calendário. Gostaria de saber como faço para posicionar o calendário abaixo do GET. Já vi vários exemplos mas não estou conseguindo fazer. Abaixo tenho uma Dialog com as posições corretas em relação a um GET, porém quando mudo de GET ele não coloca na posição correta, ou seja, não consigo fazer o relacionamento da posição do GET para achar a posição correta da Dialog. Desde já agradeço.

Meu GET

  REDEFINE GET OGMC1 VAR ABE ID 106 OF ODLGMC PICTURE "99/99/9999" BITMAP "CALENDAR" ;
  ACTION CALEND(@ABE,OGMC1) WHEN (LETRA="I" .OR. LETRA="A")
  OGMC1:lBtnTransparent := .t.       // transparent button

Meu Calendário

FUNCTION CALEND(oVar,oObj)
  local ocal, ARECT, LN1,CO1,LN2,CO2

  ARECT := GetClientRect( oObj:hWnd )

//  ? aRect[ 3 ] // 16
//  ? aRect[ 4 ] // 96


  LN1 := aRect[3]-6.6
  CO1 := aRect[4]-26
  LN2 := aRect[3]+2.4
  CO2 := aRect[4]+7

//  ? ln1
//  ? co1
//  ? ln2
// ? co2

//  DEFINE DIALOG oDlg FROM 9.4, 70 TO 18.4,103  Title "Calendário" COLOR CLR_BLACK,FUNDO  // Este coloca na posição correta do get


DEFINE DIALOG oDlg FROM LN1, CO1 TO LN2, CO2 Title "Calendário" COLOR CLR_BLACK,FUNDO 

ODLG : LHELPICON := .F.  // Tira a ? da janela

  @-10,-10 CALENDAR oCal VAR oVar PIXEL of oDlg;
              DBLCLICK  (oVar:= oCal:GetDate(),oObj:refresh(),oDlg:end());
              ON CHANGE oVar:= oCal:GetDate() SIZE 150,230 ;
              ACTION( oVar:= oCal:GetDate(),oObj:refresh(),oDlg:end());
              WEEKNUMBER
  ACTIVATE DIALOG oDlg 
  return nil
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...