Página 1 de 1

Nova aba NOTES

Enviado: 13 Mai 2025 10:59
por JoséQuintas
notes.png
Como vi anotações em samples, achei que seria interessante acrescentar notas.
Foi só uma idéia.

Nova aba NOTES

Enviado: 13 Mai 2025 11:02
por JoséQuintas
Pra curiosidade:

Código: Selecionar todos

   MenuOption( "NOTES",                             { |o| DemoNotes( o ) } )

Código: Selecionar todos

STATIC FUNCTION DemoNotes( oDlg )

   LOCAL oTab, cTxt, cCaption, nIndex := 1

   @ 20, 80 TAB oTab ;
      ITEMS {} ;
      OF oDlg ;
      SIZE 700, 500 ;
      STYLE WS_CHILD + WS_VISIBLE

   DO WHILE .T.
      cTxt := demo_LoadResource( "note" + Ltrim( Str( nIndex++ ) ) + ".txt" )
      IF Empty( cTxt )
         EXIT
      ENDIF
      cCaption := Substr( cTxt, 1, At( hb_Eol(), cTxt ) )
      BEGIN PAGE cCaption OF oTab
         @ 30, 60  EDITBOX cTxt ;
            SIZE 600, 400 ;
            STYLE   ES_MULTILINE + ES_AUTOVSCROLL + WS_VSCROLL + WS_HSCROLL
      END PAGE OF oTab
   ENDDO

   RETURN Nil

Código: Selecionar todos

   CASE cFileName == "demoxmltree.prg";     #pragma __binarystreaminclude "demoxmltree.prg" | RETURN %s
   CASE cFileName == "note1.txt"
      cTxt := "Size" + hb_Eol()
      cTxt += "Check size on windows, GTK 2.0, GTK 3.0" + hb_Eol()
      cTxt += "Some controls need different size on each ambient" + hb_Eol()
      cTxt += "as example, combobox size is list size on windows but line size on linux"
   CASE cFileName == "note2.txt"
      cTxt := "Optional" + hb_Eol()
      cTxt += "On some controls you do not need to specify all parameters." + hb_Eol()
      cTxt += "But some of them can't be empty on windows/linux" + hb_Eol()
   CASE cFileName == "note3.txt"
      cTxt := "MDI" + hb_Eol()
      cTxt += "Dialogs MDI available only on windows"
   CASE cFileName == "note4.txt"
      cTxt := "Icon" + hb_Eol()
      cTxt += "On windows ico is ICON and on linux ico is BITMAP" + hb_Eol()
      cTxt += "Attention when using hicon(), hbitmap(), @ ICON, @ BITMAP"  + hb_Eol()
   CASE cFileName == "note5.txt"
      cTxt := "Samples" + hb_Eol()
      cTxt += "Most samples are on demoall" + hb_Eol()
      cTxt += "And most samples can be compiled standalone using" + hb_Eol()
      cTxt += "hbmk2 samplename.prg"
   CASE Right( cFilename, 4 ) == ".txt"
      RETURN Nil
   OTHERWISE
      hwg_MsgInfo( "Not in demoall.prg #pragma " + cFileName )
   ENDCASE

RETURN cTxt
Poderia ser arquivo txt externo, mas como é só uma idéia, que pode ser removida, deixei junto aos resources.

Nova aba NOTES

Enviado: 13 Mai 2025 11:15
por JoséQuintas
Pensando bem....

Dá pra acrescentar sobre WINDOW e DIALOG, que tem comportamento diferente.
Sobre recursos que tem funcionamento diferente em WINDOW/DIALOG.

Pode eliminar anotações nos exemplos, que nem todo exemplo tem, e evitar novas anotações.
A de ICON por exemplo, haviam anotações de não funcionar no windows, porque foi usado BITMAP.
E a partir do windows vista, PNG pode ser usado como ICON, em determinadas situações.

É um manual pra quem não gosta de manual, já vê no próprio exemplo kkkk

Sei lá... a idéia foi lançada.
O conteúdo vém com o tempo.