Page 1 of 2

Folders multilinea ( Solved )

PostPosted: Wed Jun 16, 2010 12:30 am
by Raymundo Islas M.
Antonio/Daniel,

Hay alguna noticia del pequeño desfaze en los folders multilineas ??

Necesito agregar un par de opciones a varios folders y seria fantastico poder hacerlos hacerlos multilinea, ya que se me agoto el espacio para los prompts.

Ya que a nadie les gusto los botones con flechas que salen en la esq. superior derecha para accesar a las siguientes opciones ( ni a mi ) :?


Saludos

Re: Folders multilinea

PostPosted: Wed Jun 16, 2010 2:52 am
by Daniel Garcia-Gil
Raymundo

mira el ejemplo testfldm.prg, alli tienes un ejemplo de los folder multilinea

Re: Folders multilinea

PostPosted: Wed Jun 16, 2010 3:41 am
by Raymundo Islas M.
Daniel,

La unica diferencia que encontre fue :

Code: Select all  Expand view

CONTROL "FOLDERS",  11, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | TCS_MULTILINE, 4, 4, 324, 227       <== En Samples
CONTROL ""       , 103, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | TCS_MULTILINE, 50, 5, 463, 358      <== En mi .RC
 


De hecho, si me mostraba las 2 lineas de Prompts, solo que en la parte inferior se "comia" la linea que limita al folder.

En este momento solo cheque el codigo, deja hago mas tarde un par de pruebas colocando la palabra "FOLDERS" en mi archivo .RC

PD : Al intentar abrir el archivo testfldm.rc con WS me indica que que no esta completa la linea donde esta el TCS_MULTILINE aunque si genera correctamente el .exe y de igual manera se muestran correctas las 2 lineas del folder.


Te aviso si todo sale Ok !


Gracias y Saludos

Re: Folders multilinea

PostPosted: Thu Jun 17, 2010 2:56 pm
by Raymundo Islas M.
Daniel,

Ya hice pruebas y nop, sigue igual.

Si me pinta las 2 lineas de prompts, pero se sigue "comiendo" la linea de abajo del folder.

Image

Ahora, este folder esta dentro de una pestaña de otro folder.

Ya probe poniendo las intrucciones en el on init del Dialog main, usando el binit del folder padre y tambien en el multilinea, y nada.

Saludos

Re: Folders multilinea

PostPosted: Wed Jun 23, 2010 8:44 pm
by ruben Dario
Raymundo Islas M. wrote:Daniel,

Ya hice pruebas y nop, sigue igual.

Si me pinta las 2 lineas de prompts, pero se sigue "comiendo" la linea de abajo del folder.

Image

Ahora, este folder esta dentro de una pestaña de otro folder.

Ya probe poniendo las intrucciones en el on init del Dialog main, usando el binit del folder padre y tambien en el multilinea, y nada.

Saludos



Puedes publicar el ejemplo del Folder que muestras , el fondo con trayado como lo haces. veo que calza el texto con la linea del fondo.
Gracias

Re: Folders multilinea

PostPosted: Wed Jun 23, 2010 9:35 pm
by Raymundo Islas M.
Ruben,

Es un XBrowse con un bitmap de fondo, en este caso en el stone.bmp que viene en la carpeta bitmaps, basta que lo apliques como : oBrw:SetBackGround( oBmp )

Saludos

Re: Folders multilinea

PostPosted: Thu Jun 24, 2010 4:41 pm
by ruben Dario
Raymundo Islas M. wrote:Ruben,

Es un XBrowse con un bitmap de fondo, en este caso en el stone.bmp que viene en la carpeta bitmaps, basta que lo apliques como : oBrw:SetBackGround( oBmp )

Saludos


A partir de que version de FWH tiene oBrw:SetBackGround( oBmp )
porque tengo la 8.03 No lo reconoce

Re: Folders multilinea

PostPosted: Thu Jun 24, 2010 5:03 pm
by Raymundo Islas M.
Ruben,

Buena pregunta, esa te la contestaria mejor Antonio y/o Daniel pero le quiero calcular que desde hace algunos meses.

Creo, no estoy muy seguro, que en versiones anteriores se maneja de manera diferente, checate el xbrowse.ch o mejor aun, en la carpeta samples.

Yo usaba una version mas atrazada que latuya (7.12) y apenas me actualize hace un par de meses y estoy haciendo uso de todas las nuevas bondades que ofrece.


Saludos

Re: Folders multilinea

PostPosted: Thu Jun 24, 2010 6:56 pm
by Antonio Linares
Raymundo,

Basicamente por lo que he leido es un folder en una pestaña de otro folder, si ?

Re: Folders multilinea

PostPosted: Thu Jun 24, 2010 7:18 pm
by Raymundo Islas M.
Master Antonio,

Asi es, el folder multiline no lo defino sobre el dialog directamente, esta contenido dentro de una pestaña de otro folder.

Saludos

Re: Folders multilinea

PostPosted: Fri Jun 25, 2010 9:29 pm
by Antonio Linares
Raymundo,

Partamos de un ejemplo que podamos probar todos :-)

test.prg // de momento sin usar multiples líneas de tabs en el folder interior
Code: Select all  Expand view
#include "FiveWin.ch"
 
function Main()
 
   local oDlg, oFld1, oFld2
   
   DEFINE DIALOG oDlg RESOURCE "Test"
 
   REDEFINE FOLDER oFld1 ;
      PROMPTS "One", "Two", "three" ;
      DIALOGS "Another", "Two", "Three" ;
      ID 100 OF oDlg

   REDEFINE FOLDER oFld2 ;
      PROMPTS "One", "Two", "three" ;
      DIALOGS "One", "Two", "Three" ;
      ID 200 OF oFld1:aDialogs[ 1 ]
     
   ACTIVATE DIALOG oDlg CENTERED
 
return nil
 


test.rc
Code: Select all  Expand view
#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif
 
test DIALOG 17, 36, 185, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 100, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 6, 175, 170
 DEFPUSHBUTTON "OK", 1, 67, 180, 50, 14
}

another DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
 CONTROL "", 200, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 6, 162, 140
}
 
one DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
   PUSHBUTTON "Test", 10, 5, 5, 148, 115
}
 
two DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 
three DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 


Se ve asi:
Image

Ahora probemos con multiples líneas de pestañas...

Re: Folders multilinea

PostPosted: Fri Jun 25, 2010 9:39 pm
by Antonio Linares
Efectivamente como comentabas, el diálogo interior invade el margen inferior:

Code: Select all  Expand view
#include "FiveWin.ch"
 
function Main()
 
   local oDlg, oFld1, oFld2
   
   DEFINE DIALOG oDlg RESOURCE "Test"
 
   REDEFINE FOLDER oFld1 ;
      PROMPTS "One", "Two", "three" ;
      DIALOGS "Another", "Two", "Three" ;
      ID 100 OF oDlg

   REDEFINE FOLDER oFld2 ;
      PROMPTS "One", "Two", "three", "four", "five", "six" ;
      DIALOGS "One", "Two", "Three", "One", "Two", "Three" ;
      ID 200 OF oFld1:aDialogs[ 1 ]
     
   ACTIVATE DIALOG oDlg CENTERED
 
return nil
 


test.rc
Code: Select all  Expand view
#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif
 
test DIALOG 17, 36, 185, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 100, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 6, 175, 170
 DEFPUSHBUTTON "OK", 1, 67, 180, 50, 14
}

another DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
 CONTROL "", 200, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_MULTILINE, 5, 6, 162, 140
}
 
one DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
   PUSHBUTTON "Test", 10, 5, 5, 148, 115
}
 
two DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 
three DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 

Asi se ve:
Image

Re: Folders multilinea

PostPosted: Fri Jun 25, 2010 9:45 pm
by Raymundo Islas M.
Master Antonio,

Es exactamente como lo indicas.

Disculpa si desde un principio se me paso comentar que era un folder contenido en otro.

Saludos.

Re: Folders multilinea

PostPosted: Fri Jun 25, 2010 9:50 pm
by Antonio Linares
Y podemos ajustarlo modificando el dato nFdHeight del folder:

test.prg
Code: Select all  Expand view
#include "FiveWin.ch"
 
function Main()
 
   local oDlg, oFld1, oFld2
   
   DEFINE DIALOG oDlg RESOURCE "Test"
 
   REDEFINE FOLDER oFld1 ;
      PROMPTS "One", "Two", "three" ;
      DIALOGS "Another", "Two", "Three" ;
      ID 100 OF oDlg

   REDEFINE FOLDER oFld2 ;
      PROMPTS "One", "Two", "three", "four", "five", "six" ;
      DIALOGS "One", "Two", "Three", "One", "Two", "Three" ;
      ID 200 OF oFld1:aDialogs[ 1 ]
     
   oFld2:nFdHeight = 39  
     
   ACTIVATE DIALOG oDlg CENTERED
 
return nil
 


test.rc
Code: Select all  Expand view

 #ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif
 
test DIALOG 17, 36, 185, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 100, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 6, 175, 170
 DEFPUSHBUTTON "OK", 1, 67, 180, 50, 14
}

another DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
 CONTROL "", 200, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_MULTILINE, 5, 6, 162, 140
}
 
one DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
   PUSHBUTTON "Test", 10, 5, 5, 148, 105
}
 
two DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 
three DIALOG 6, 15, 175, 117
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
}
 

Asi se ve ahora:
Image

Re: Folders multilinea

PostPosted: Fri Jun 25, 2010 10:10 pm
by Antonio Linares
Se puede intentar automatizar el cálculo de dicha altura de esta forma:

test.prg
Code: Select all  Expand view
#include "FiveWin.ch"
 
function Main()
 
   local oDlg, oFld1, oFld2
   
   DEFINE DIALOG oDlg RESOURCE "Test"
 
   REDEFINE FOLDER oFld1 ;
      PROMPTS "One", "Two", "three" ;
      DIALOGS "Another", "Two", "Three" ;
      ID 100 OF oDlg

   REDEFINE FOLDER oFld2 ;
      PROMPTS "One", "Two", "three", "four", "five", "six" ;
      DIALOGS "One", "Two", "Three", "One", "Two", "Three" ;
      ID 200 OF oFld1:aDialogs[ 1 ]
     
   // oFld2:nFdHeight = 39  
     
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oFld2:nFdHeight := FldGetItemHeight( oFld2:hWnd ),;
                oFld2:ReSize( 0, oFld2:nWidth, oFld2:nHeight - oFld2:nFdHeight - 2 ) )
 
return nil

#pragma BEGINDUMP

#include <windows.h>
#include <commctrl.h>
#include <hbapi.h>

HB_FUNC( FLDGETITEMHEIGHT )
{
   RECT rct;
   
   SendMessage( ( HWND ) hb_parnl( 1 ), TCM_GETITEMRECT, 1, ( LPARAM ) &rct );
   
   hb_retnl( rct.bottom - rct.top );
}

#pragma ENDDUMP