Enero 26, 2006

Completando TextView 2 parte

El widget TextView alcance su segunda revision en T-Gtk

Ya esta actualmente terminada la 2 implementacion que se lleva a cabo al widget T-Gtk.

Faltan muchas mas cosas, pero de momento, dejaremos este widget para centrarnos en otros asuntos que más nos urgen en estos momentos.

He terminado de implementar que todo se realice a traves de programacion orientado al objeto, para que sea mas rápido y fácil su uso.

Ayer tuve ocasion de poder actualizar T-Gtk para mi GNU/Linux Debian , y pude comprobar que tal funciona en los dos sistemas.
La verdad, es que es sorprendente el trabajo realizado por la gente de Gtk, Gnome, GNU, y el software libre en general.

En fin, para no aburrir , dejo aqui las imagenes:
textview_linux.gif
T-GTK en GNU/Linux

El mismo codigo, pero bajo Windows:
textview_windows.jpg

Podeis apreciar que es identico ;-), es la gracia de programar una vez y compilar en distintos entornos.

El codigo fuente, tanto en un sistema como en otro, y que estará disponible en la proxima liberacion de T-Gtk :

// Ejemplo TextView soportando imagenes y tags  
// (c)2003-2006 Rafa Carmona

#include "gclass.ch"

#define GTK_WRAP_WORD 2
#define GTK_TEXT_DIR_RTL 2
#define PANGO_STYLE_ITALIC 2
#define PANGO_SCALE 1024

Function Main()
Local cText := "Power of TextView" + CRLF, oWnd, oTextView, oScroll

DEFINE WINDOW oWnd TITLE "Oh!! TextView POWER" SIZE 500,500
DEFINE SCROLLEDWINDOW oScroll OF oWnd CONTAINER
DEFINE TEXTVIEW oTextView VAR cText OF oScroll CONTAINER

Create_Text( oTextView )

ACTIVATE WINDOW oWnd CENTER

RETURN NIL

STATIC FUNCTION Create_Text( oTextView )
Local oFile := gTextFile():New( "readme.txt", "R" )
Local nWhere := 1
Local aStart := Array( 14 ),oImage, j, cLine

// Example insert from AT_CURSOR and source file txt
oFile:Goto( 1 )
while !oFile:lEoF
cLine := oFile:Read()
oTextView:Insert( cLine )
oFile:Goto( ++nWhere )
end while

oFile:Close()

// Ok, i put my image in TextView ;-)
oTextView:oBuffer:GetIterAtOffSet( aStart, -1 )
DEFINE IMAGE oImage FILE "../../images/gnome-foot.png" LOAD
For j := 1 To 10
oTextView:Insert_Pixbuf( aStart, oImage )
Next

// Ops, new line ;-)
oTextView:Insert( CRLF )

// Ah! Tags examples....
oTextView:oBuffer:GetIterAtOffSet( aStart, -1 )
oTextView:CreateTag( "heading", { "weight", 700,;
"size", 10*PANGO_SCALE,;
"justification", GTK_JUSTIFY_CENTER } )
oTextView:Insert_Tag( "(c)2006 Rafa Carmona" , "heading", aStart )
// New image
DEFINE IMAGE oImage FILE "../../images/rafa2.jpg" LOAD
oTextView:Insert_Pixbuf( aStart, oImage )

// Ops, new line ;-)
oTextView:Insert( CRLF )

// Eh!, you localicate you position with GetIterAtOffset
oTextView:oBuffer:GetIterAtOffSet( aStart, -1 )
DEFINE IMAGE oImage FILE "../../images/gnome-gsame.png" LOAD
For j := 1 To 10
oTextView:Insert_Pixbuf( aStart, oImage )
Next

// Ops, new line ;-)
oTextView:Insert( CRLF )
oTextView:oBuffer:GetIterAtOffSet( aStart, -1 )
oTextView:CreateTag( "blue_fore",{ "foreground", "blue" } )
oTextView:CreateTag( "red_back", { "background", "red" } )

oTextView:CreateTag( "blue_and_red", { "background", "red", "foreground", "blue",;
"justification", GTK_JUSTIFY_CENTER,;
"weight", 700, "size", 14*PANGO_SCALE } )

oTextView:Insert_Tag( "This text is blue foreground , yes..." , "blue_fore", aStart )
oTextView:Insert_Tag( "...and this text is red background , yes..."+ CRLF + CRLF,;
"red_back", aStart )
oTextView:Insert_Tag( "...Oh!! this text is TOTAL, yes..."+CRLF+CRLF ,;
"blue_and_red", aStart )

// Put Code source in TexView.
oTextView:CreateTag( "window", { "background", "yellow",;
"foreground", "blue",;
"left_margin", 20,;
"right_margin", 20 } )
oTextView:CreateTag( "window_back", { "left_margin", 20, "right_margin", 20 } )
oTextView:CreateTag( "comment", { "style", PANGO_STYLE_ITALIC,;
"left_margin", 20,;
"right_margin", 20,;
"foreground", "darkred" } )

oTextView:Insert( "Well, this example you view personality your MEMOS under [x]Harbour" +CRLF )
oTextView:Insert( "Code source from direct file: " + CRLF + CRLF)

oFile := gTextFile():New( "textview.prg", "R" )
nWhere := 1

oTextView:oBuffer:GetIterAtOffSet( aStart, -1 )
oFile:Goto( 1 )
while !oFile:lEoF
cLine := oFile:Read()
DO CASE
CASE "WINDOW" $ cLine
oTextView:Insert_Tag( cLine , "window", aStart )
CASE "//" $ cLine
DEFINE IMAGE oImage FILE "../../images/header.png" LOAD
oTextView:Insert_Pixbuf( aStart, oImage )
oTextView:Insert_Tag( cLine , "comment", aStart )
OTHERWISE
oTextView:Insert_Tag( cLine , "window_back", aStart )
ENDCASE
oFile:Goto( ++nWhere )
end while
oFile:Close()

Return NIL

Escrito por Rafa Carmona a las Enero 26, 2006 02:22 PM
Comentarios

  最好的翻译公司在上海,不仅是使领馆指定翻译机构,同时也是500强定点翻译公司。提供的商务口译,高端笔译同声传译等翻译服务。公司提供英语翻译日语翻译韩语翻译等50多个语种的翻译服务。上海翻译公司立足于学术翻译领域,并且在行业翻译领域如经济翻译法律翻译等颇有建树,公司还提供澳大利亚移民的证件翻译服务。

Escrito por translation a las Octubre 16, 2007 05:04 AM

网络营销软件
网络营销软件
网络营销软件
群发软件
群发软件
---
群发软件
博客群建软件
网络营销软件
论坛群发软件
网站排名软件
群发软件
推广小助手破解版
论坛群发
网站排名软件
群发软件
推荐给你很好的群发软件信息群发软件和供求群发软件
推荐给你很好的群发软件信息群发软件和供求群发软件博客群发软件网络营销软件网络营销软件
网站排名软件网站排名软件网站优化软件信息群发软件信息群发软件信息群发软件论坛群发软件网站推广软件网站推广软件博客群发软件博客群发软件
群发软件
网络营销软件
论坛群发
网站推广软件
群发软件群发软件博客群发软件论坛群发软件网络营销软件论坛群发软件
信息群发软件推广软件网站推广软件网络营销软件网站推广软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件
网站排名软件
群发软件
博客群发软件
网站排名软件
网站推广软件
群发软件信息群发软件
免费论坛群发软件
论坛群发软件
网站排名软件
免费博客群发软件
网站推广软件

群发软件
博客群发软件
网站排名软件
网站推广软件
群发软件信息群发软件
免费论坛群发软件
论坛群发软件
网站排名软件
免费博客群发软件
博客群发软件
信息群发软件
论坛群发软件
信息群发软件
博客群发软件
qq群发软件
邮件群发软件
博客群建软件
企业名录搜索软件
信息群发软件
邮件群发软件
论坛群发软件
博客群发软件
网站推广软件
网络营销软件
全能营销破解版
网络营销软件
论坛群发软件
论坛群发软件
论坛群发软件
网络营销软件
信息群发软件
信息群发软件
信息群发软件
群发软件
论坛群发软件

Escrito por 群发软件 a las Febrero 10, 2008 01:59 PM
Escribir un comentario









¿Recordar informacion personal?